05-21-2025, 05:44 PM
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?
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.
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.