08-20-2022, 11:56 AM
If you want to complicate your life further but absolutely hate the type sigils, especially for a string "function" then a "SUB" with "side-effects" could work. Have to declare variables "AS STRING" to keep avoiding that dollar sign...
I like to put "SUB" parameters at the end, those that will have the "side-effects".
Code: (Select All)
''Example:
DIM SA AS STRING
SA = ""
PRINT SA
CALLME "Hello!", SA
PRINT SA
END
SUB CALLME (SVAL AS STRING, SINP AS STRING)
SINP = SVAL
END SUB
''as opposed to:
DIM SA AS STRING
SA = ""
PRINT SA
SA = CALLME$("Hello!")
PRINT SA
END
FUNCTION CALLME$ (SVAL AS STRING)
CALLME$ = SVAL
END FUNCTION
I like to put "SUB" parameters at the end, those that will have the "side-effects".