xboxscene.org forums

OG Xbox Forums => Official MediaXMenu (MXM) Forum => Dashboard Forums => MXM ActionScripting Forum => Topic started by: Jezz_X on February 17, 2004, 12:53:00 PM

Title: Possible Bug In Case Or If
Post by: Jezz_X on February 17, 2004, 12:53:00 PM
Playing around again and notice that this

CODE

CASE 201
 IF %dialogname% == step1dialog GOTO SETSECONDVALUE
 IF %dialogname% == step2dialog GOTO SETORIGINALVALUE
ENDCASE

Wont work in the event handler of a dialog
But this Will
CODE

CASE 201
 IF %dialogname% == step1dialog THEN
   GOTO SETSECONDVALUE
 ENDIF
 IF %dialogname% == step2dialog THEN
   GOTO SETORIGINALVALUE
 ENDIF
ENDCASE
Title: Possible Bug In Case Or If
Post by: flattspott on February 17, 2004, 01:29:00 PM
Why not just do this

CASE 201
IF %dialogname% == step1dialog THEN
  GOTO SETSECONDVALUE
ELSE
  GOTO SETORIGINALVALUE
ENDIF
ENDCASE
Title: Possible Bug In Case Or If
Post by: BenJeremy on February 17, 2004, 01:36:00 PM
ARRGGHH!!!

Please do NOT use GOTOs in CASE statements. That's like crossing the proton streams. Very bad.
Title: Possible Bug In Case Or If
Post by: Jezz_X on February 17, 2004, 01:38:00 PM
Because it acutally has 4 things it has to check really I just didn't want to post them all so its not just a 2 choice check
Title: Possible Bug In Case Or If
Post by: Jezz_X on February 17, 2004, 01:38:00 PM
QUOTE (BenJeremy @ Feb 17 2004, 11:29 PM)
ARRGGHH!!!

Please do NOT use GOTOs in CASE statements. That's like crossing the proton streams. Very bad.

Why not it works fine
Title: Possible Bug In Case Or If
Post by: BenJeremy on February 17, 2004, 01:34:00 PM
QUOTE (Jezz_X @ Feb 17 2004, 06:31 PM)
QUOTE (BenJeremy @ Feb 17 2004, 11:29 PM)
ARRGGHH!!!

Please do NOT use GOTOs in CASE statements. That's like crossing the proton streams. Very bad.

Why not it works fine

Probably.... just makes me shudder wink.gif In reality, SWITCH doesn't leave anything on the IP stack, so it's probably OK.

As to the problem with single line IFs, I'm not sure what's happening there.
Title: Possible Bug In Case Or If
Post by: Jezz_X on February 17, 2004, 01:52:00 PM
OK then I ask this how else are you supposed to process data and execute actions from a button press or action in a dialog box
Title: Possible Bug In Case Or If
Post by: BenJeremy on February 17, 2004, 02:23:00 PM
QUOTE (Jezz_X @ Feb 17 2004, 06:45 PM)
OK then I ask this how else are you supposed to process data and execute actions from a button press or action in a dialog box

you can use nested SWITCH statements.

If blocks should also work.
Title: Possible Bug In Case Or If
Post by: geniusalz on February 17, 2004, 02:53:00 PM
smile.gif

Anyway, I think GOSUB can work well too