Can't do the math

Yates, Glen JAMES.G.YATES at saic.com
Fri Mar 1 17:32:01 EST 2002


When parsing words, multiple spaces are ignored, so word 3 ends up being the
first user in the group, not the group number you want to test against, so
try this instead.

  set the itemDelimiter to ":"
  repeat with x = 1 to the number of lines in varAllGroups
    if item 3 of line x of varAllGroups > 100 then
      put first item of line x of varAllGroups & return after field
"allgroups"
    end if
  end repeat

-Glen Yates

-----Original Message-----
From: Bill Vlahos [mailto:bvlahos at jpl.nasa.gov]
Sent: Friday, March 01, 2002 3:59 PM
To: use-revolution at lists.runrev.com
Subject: Can't do the math


Using Rev 1.1.1B1 on Mac OS X the if statement below doesn't work 
correctly.
Here is the variable varAllGroups:

root::0:root
other::1:
bin::2:root,bin,daemon
sys::3:root,bin,sys,adm

Here is the script:

   replace ":" with space in varAllGroups --to make words for parsing
   repeat with x = 1 to the number of lines in varAllGroups
     if word 3 of line x of varAllGroups > 100 then
       put first word of line x of varAllGroups & return after field 
"allgroups"
     end if
   end repeat

The if statement doesn't do the math correctly. The lines 1, 3, and 4 
evaluate to true when they shouldn't.

Bill Vlahos



More information about the use-livecode mailing list