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

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Detecting the current slot

  • #1 ✎ 1785 12Me21 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 ✎ 1026 snail_ 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 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 ✎ 1785 12Me21 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