string handling

ckb

Minion
Staff member
I am working on a script that involves some string parsing, but I have having trouble.  I started with a very simple script, but I can not get it to run (in ver10.8 )

Code:
void main()
{
   if contains_text( "random string of nothing", "dots" ) { print("We have dots");}
   else { print("Nothing found"); }
}

I get an error of:
Expected (, found contains_text (stst.ash, line 4)

What is going wrong here?

ckb
 

gemelli

Member
If statements need the argument you're testing to appear inside parentheses. Like this:

Code:
void main()
{
   if(contains_text( "random string of nothing", "dots" )) 
   {
      print("We have dots");
   } 
   else
   {
      print("Nothing found");
   }
}

Hope this helps!
 

ckb

Minion
Staff member
[quote author=gemelli link=topic=830.msg4017#msg4017 date=1175286233]
If statements need the argument you're testing to appear inside parentheses. [/quote]

Oh, man! Not only am I an idiot, but I am also an asshole. How could I have forgoton something so simple? Thanks muchly for the help.
My scripting skills have grown mighty rusty.

ckb
 
Top