? Detecting the current slot (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Detecting the current slot

  • #1 ✎ 1626 12Me21 Head Admin Third Year My account is over 3 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself PRGNAME$() 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 Edited by 12Me21
  • #2 ✎ 906 snail_ Helper Received for being very helpful around SmileBASIC Source Achievements OSP Contest 2 Contest Participant I participated in the second SmileBASIC Source OSP Contest! Night Person I like the quiet night and sleep late. Express Yourself 12me 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
  • #3 ✎ 1626 12Me21 Head Admin Third Year My account is over 3 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself I only use high quality suffixes Posted