jerkdavi Posted August 26, 2021 Share Posted August 26, 2021 (edited) Hello . I am quite new to SCM programming and to this forum, so I hope I am posting this in the right place. . I have a bit of programming knowledge in C and JS, so I am wondering if it is at all possible to do multiple if functions, or something like switch case in SCM? . if (condition) statement; else if (condition) statement; . . else statement; . switch (user_input) { case 1: // Code break; case 2: // Code break; . . default: // Code break; } . Cheers! Edited August 26, 2021 by jerkdavi Link to comment Share on other sites More sharing options...
jerkdavi Posted August 26, 2021 Author Share Posted August 26, 2021 I realised how to do it . :TEST_03 wait 0 if 0AB0: key_pressed 49 then // Code end if 0AB0: key_pressed 50 then // Code end jf @TEST_03 . Link to comment Share on other sites More sharing options...
OrionSR Posted August 26, 2021 Share Posted August 26, 2021 1 hour ago, jerkdavi said: or something like switch case in SCM? Check out SA's switch case/jump table opcodes, 0871: and 0872:. Link to comment Share on other sites More sharing options...
cjfan_ Posted September 11, 2021 Share Posted September 11, 2021 (edited) Also you can do this IF x == y THEN x += 1 ELSE IF y == 2 THEN y += 1 END END Edited September 11, 2021 by GrGTaGamer Link to comment Share on other sites More sharing options...
XMDS Posted September 13, 2021 Share Posted September 13, 2021 It will be supported in future versions of SB tools, see: https://github.com/sannybuilder/dev/issues/160 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now