Does an If script always need an Else?
Silver
24 Feb 2015, 16:36I'm more thinking of best coding practice here. I know it works, in Quest at least, without an else. I'm sure I saw Alex mention once that If scripts that didn't resolve with an else caused errors with questjs, although I could be remembering incorrectly.

jaynabonne
24 Feb 2015, 16:54I did a site search and can't find a reference to that. I would hope not, but perhaps you can email or PM Alex.
Silver
24 Feb 2015, 16:59It's perhaps more likely that I've misread something. I thought he gave some reason behind the errors with questjs being something to do with If scripts. Anyway, I don't plan on using questjs, was just wondering.
Alex
24 Feb 2015, 17:09A common error I've seen in questjs is where an "if" has no condition.
e.g.
So... don't do that. I think it happens when people add an "if" in the editor and then forget to do anything with it.
e.g.
if () {
// some code here
}
So... don't do that. I think it happens when people add an "if" in the editor and then forget to do anything with it.
Silver
24 Feb 2015, 17:20Ah. Glad that got cleared up. I knew something had been mentioned but couldn't remember what.
Silver
24 Feb 2015, 17:24I guess that means it doesn't flag up as an error in Quest.
Alex
24 Feb 2015, 17:34Yep, Quest doesn't care, but JavaScript does. I suppose the converter should just remove an "if" with an empty condition. Who knows, maybe it already does - been a while since I last looked at it.
Silver
25 Feb 2015, 17:58Alex wrote:Yep, Quest doesn't care, but JavaScript does. I suppose the converter should just remove an "if" with an empty condition. Who knows, maybe it already does - been a while since I last looked at it.
Given you're making Quest 6 use javascript as the internal language, I'm surprised you haven't experimented with using this to convert the internal aslx stuff.

(I'm pulling your leg, but it's a semi-serious proposition also.)
Silver
25 Feb 2015, 18:00Although it works with .quest files not aslx ones, derr silly me.