I\'m facing something weird in VBScript. When writing a procedure where I want the parameter to be passed by reference, the way of calling this procedure changes the way the
IncrementByRef Num
calls and increments using a reference to Num
IncrementByRef (47 + 3)
calls and increments using a reference to "50". Which is discarded on exit.
IncrementByRef (Num)
IncrementByRef (Num + 18)*5
IncrementByRef Cint("32")
Are all legal in BASIC, as they were in FORTRAN. Notoriously, in one early FORTRAN, passing by ref allowed you to change the value of expressions like
5
Which was sufficiently confusing that only very small, early FORTRAN compilers had that kind of behaviour.