Jump to content

Some $iif Help


Guest X-Fusion

Recommended Posts

Guest X-Fusion

I'm currently working on an error checking for my trivia script for VSIXc. I'm using $iif's to scan through the variables and determine if previous variables were present or not. At the current moment, my first set of variables goes through fine. While preforming the second check, I get an * Invalid format: $iif (line 298, trivscript.mrc). So, checking line 298, it looks the same as line 295, which is the last instance in which the error checking worked fine. Anyway, line 298 is:

  $iif(!%tri.color,set %tri.color $?"Please set the color for trivia (Must be in HTML format. If you do not understand please click cancel",halt)

I've tried removing halt, which of course would return $false which is in essence what I would like it to do. So, any help would be much appreciated.

While looking at this, would it be wise to remove the () since I'm using $iif? My other set didn't have it, and it worked fine.

Link to comment
Share on other sites

I would remove the parenthesis or replace them with $chr. Also, you do not need to say halt.

 

$iif(this is true,do this) This automatically returns if it is $false.

 

And one little thing. Is it absolutely neccesary to use $iif vs. a regular if statement?

Link to comment
Share on other sites

Guest X-Fusion

I've removed halt. I'm using $iif because I don't see a need to completely use a regex statement for things like that. It's not about speed, and in the end, I'm going for simplicity.

Edit, I've removed ( and not used $chr, and it's working correctly now. Topic resolved, topic closed.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...