Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Determining if variable or static string is passed to a Sub
#2
SUB SomeRoutine (a$, state)
   IF state THEN PRINT "Variable" ELSE PRINT }Static"
END SUB

Then just send the sub a call with the flag desired.

SomeRoutine a$, -1
SomeRoutine "Hello World", 0

There's no auto detection, but it's simple enough to pass a flag with that information.
Reply


Messages In This Thread
RE: Determining if variable or static string is passed to a Sub - by SMcNeill - 05-21-2025, 05:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable length type declarations dano 5 686 08-06-2025, 09:53 PM
Last Post: dano
  Most efficient way to build a big variable length string? mdijkens 9 1,876 01-17-2025, 11:36 PM
Last Post: ahenry3068
  Huge array of variable length strings mdijkens 9 1,826 10-17-2024, 02:01 PM
Last Post: mdijkens
  REDIM, TYPE, and STRING Woes TerryRitchie 16 3,134 04-13-2023, 05:17 AM
Last Post: DSMan195276
Lightbulb To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable mnrvovrfc 4 1,179 09-29-2022, 02:51 AM
Last Post: mnrvovrfc

Forum Jump:


Users browsing this thread: 1 Guest(s)