Sign In

Detecting the current slot

#1✎ 169012Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfPRGNAME$() returns the name of the program in the current slot by default, and you can compare the result with PRGNAME$(SlotNumber).
DEF CURRENTSLOT()
VAR NAME$=PRGNAME$()
VAR SLOT%
FOR SLOT%=0 TO 3
IF NAME$==PRGNAME$(SLOT%) THEN RETURN I%
NEXT
RETURN -1
END
EDIT: there's a possibly better way using BACKTRACE and CHKCHR
Posted 2 years ago
Edited 2 years ago
by 12Me21

#2✎ 943snail_HelperReceived for being very helpful around SmileBASIC SourceAchievementsOSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source OSP Contest!Night PersonI like the quiet night and sleep late.Express Yourself12me using suffixes???
Lol anyway this is pretty clever. I was thinking about how someone would do this recently. Only problem I can imagine is if two slots have the same name for whatever reason.
Posted 2 years ago

#3✎ 169012Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfI only use high quality suffixes
Posted 2 years ago