Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Determining if variable or static string is passed to a Sub
#1
Is there a way that I can determine from within the Sub (or Function) if a variable string was passed or a static string was passed?

Code: (Select All)

a$ = "DataThatIsPassed"

SomeRoutine (a$)
SomeRoutine (" DataThatIsPassed ")



Sub SomeRoutine (a$)
    Print "processing goes here to determine what was sent..."
    Print "If a variable was sent then VariableWasSent% = 1"
    Print "Otherwise VariableWasSent%=0"

    If VariableWasSent% = 1 Then Print "Variable string was sent"
    If VariableWasSent% = 0 Then Print "Static string was sent"
End Sub


If there exists a way to do this, the example above would provide the following results:

Variable string was sent
Static string was sent


The reason I need this is because I am adding functionality to a very old library routine that is entrenched in so many programs that is would be a monumental task to change.  In order to bring the new functionality to the old routine I need to be able to determine what was sent.
Reply


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



Users browsing this thread: 1 Guest(s)