Skip to content
General IRCX

Some $iif Help

A TG007 community discussion started by X-Fusion.

Closed discussion 3 posts
Page 1 of 1
Closed
Topic #8983 · 3 published posts · 1,779 views

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.

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?

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.

Edited Sep 23, 2007 8:39 PM by X-Fusion