How can you determine if a DEF argument is a number or an array?
#1✎ 90HackTheWorldsSecond YearMy account is over 2 years oldWebsiteSummer 2016 Contest ParticipantI participated in the SmileBASIC Source Summer 2016 Contest!Programming ContestReadingI like to read books!HobbiesDEF 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✎ 114Autz64QSP Contest 1 WinnerI won the first SmileBASIC Source QSP Contest!Programming ContestEnd of 2017 Contest ParticipantI participated in the SmileBASIC Source End of 2017 Contest!Programming ContestDeep SleepHiddenWebsiteWith 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✎ 1130snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone 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✎ 114Autz64QSP Contest 1 WinnerI won the first SmileBASIC Source QSP Contest!Programming ContestEnd of 2017 Contest ParticipantI participated in the SmileBASIC Source End of 2017 Contest!Programming ContestDeep SleepHiddenWebsite
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