Re: Valid command form?

new topic     » goto parent     » topic index » view thread      » older message » newer message

EU>is command valid/supported: "if equal(s[1],"r")=0 then ..."? Its the ONLY
EU>way i can get the evaluation performed.  Any help would be greatly
EU>appreciated.  thanks
EU>===============================================================
EU>object w
EU>sequence s   --s can be variable length (1 to 3 bytes)
EU>s="r" puts(1,s) puts(1,"    :  ")
EU>if equal(s,"r") then puts(1,"1EQ ") else puts(1,"1NQ ") end if
EU>puts(1,"\n")         ¦
EU>s="r" puts(1,s) puts(1,"    :  ")
EU>if equal(s[1],"r") then puts(1,"2EQ ") else puts(1,"2NQ ") end if
EU>if compare(s[1],"r")=0 then puts(1,"2EQ ") else puts(1,"2NQ ") end if
EU>if equal(s[1],"r")=0 then puts(1,"2EQ ") else puts(1,"2NQ ") end if
EU>puts1,"\n")
EU>s="r1g" puts(1,s) puts(1,"  :  ")
EU>if equal(s[1],"r") then puts(1,"3EQ ") else puts(1,"3NQ ") end if   if
EU>compare(s[1],"r")=0 then puts(1,"3EQ ") else puts(1,"3NQ ") end if
EU>if equal(s[1],"r")=0 then puts(1,"3EQ ") else puts(1,"3NQ ") end if
EU>puts(1,"\n")
EU>s="r1g" puts(1,s) puts(1,"  :  ")
EU>if length(s)>1 then ws=s[1] else ws=s end if
EU>if equal(ws,"r") then puts(1,"4EQ ") else puts(1,"4NQ ") end if
EU>if compare(ws,"r")=0 then puts(1,"4EQ ") else puts(1,"4NQ ") end if  if
EU>equal(ws,"r")=0 then puts(1,"4EQ ") else puts(1,"4NQ ") end if
EU>====================================================================
EU>RESULTS=
EU>r    :  1EQ                                                           r    :
EU>  2NQ 2NQ 2EQ
EU>r1g  :  3NQ 3NQ 3EQ
EU>r1g  :  4NQ 4NQ 4EQ

EU>______________________________________________________
EU>Get Your Private, Free Email at http://www.hotmail.com

If s is a one-dimensional sequence (a string, for example), you must use
single quoutes instead of double quotes. For example:

if s[1] = 'r' then ...

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu