loading
 
Multiple if Statement
Ash from Malaysia  [2 posts]
12 year
hi guys...im having problems using multiple if statement..

in my program, there are 3 blobs present and with circular area variable i have 3 different values..0.6,.03 and 0.5

i would like to use if statement --if circular area>0.6 display text ( present) and --if circular area <0.6 display text (not present)

the problem is that when i change picture that have 2 blobs with values <0.6..

the program still shows (cap present) no matter what i tried.
Anonymous 12 year
Ash,

Its probably easier to use a bit of code (like VB) to do this checking. Assuming this is after a blob Filter module. Do NOT forget to select the "create array variable" in the Circular Area GUI (not the Create BLOBS array variable as that is different)

capPresent = false

blobs = GetArrayVariable("CIRCULAR_AREA")
if isArray(blobs) then
  if ubound(blobs)>=0 then

    for i = 0 to ubound(blobs)
      if blobs(i) >= 0.6 then
         capPresent = true
      end if

    next

  end if
end if

if capPresent then
  SetVariable "RESULT", "Cap Present"
else
  SetVariable "RESULT", ""
end if

Ash from Malaysia  [2 posts] 12 year
thank u for the reply..i will test it and see how it goes..thanks!

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index