? How can you determine if a DEF argument is a number or an array? (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
This website has been moved, please see this post

How can you determine if a DEF argument is a number or an array?

  • #1 ✎ 90 HackTheWorlds Second Year My account is over 2 years old Website Summer 2016 Contest Participant I participated in the SmileBASIC Source Summer 2016 Contest! Programming Contest Reading I like to read books! Hobbies DEF can accept an array or a variable as an argument (and I don't think there is anyway to stop this) so is there any way to determine at run-time whether the argument passed in is a variable or an array? Any way at all? I obviously don't want it to end the program. I'm trying to create a command that can accept one or the other. Posted
  • #2 ✎ 114 Autz64 QSP Contest 1 Winner I won the first SmileBASIC Source QSP Contest! Programming Contest End of 2017 Contest Participant I participated in the SmileBASIC Source End of 2017 Contest! Programming Contest Deep Sleep Hidden Website With SmileBASIC, i don't know yet how to check that. But you can simplify the behavior by concatenating the data on a String, each one sepparated with a semicolon: Data1 Data2 Data3 Data4 = Data1;Data2;Data3;Data4 And then check if the string has one or multiple semicolons on the way A=INSTR( 0, Your Text variable, ";" ) Posted Edited by Autz64
  • #3 ✎ 1130 snail_ Power User QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements
    EDIT: Sorry, i misread.
    If you want, you can delete your own posts. Smash that delete button. Just telling you in case you wanted to know.
    Posted
  • #4 ✎ 114 Autz64 QSP Contest 1 Winner I won the first SmileBASIC Source QSP Contest! Programming Contest End of 2017 Contest Participant I participated in the SmileBASIC Source End of 2017 Contest! Programming Contest Deep Sleep Hidden Website
    EDIT: Sorry, i misread.
    If you want, you can delete your own posts. Smash that delete button. Just telling you in case you wanted to know.
    Thanks, but i find kinda pointless to erase a post just to post another one. c:
    Posted