LoginLogin

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

Root / Programming Questions / [.]

HackTheWorldsCreated:
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.

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, ";" )

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.

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: