SBX / Function / Procedure parameter passing fixes involving unusual type conversions, such as between X and numeric variables, or between F and S variables:
• | XPUTARG N,FVAL was not doing anything if FVAL was a floating point variable and the caller had passed a string variable for parameter #N. Now it converts the floating point to a string. |
• | Passing an X (unformatted) variable to a routine expecting a numeric parameter was attempting to do a value conversion (as if the source variable had been a string) rather than a raw binary transfer (as should be the case when the source or destination is unformatted). |
For example:
MAP1 REC
MAP2 BVAL,B,2
MAP2 JUNK,F,6
call AddOne(REC)
print BVAL
end
Procedure AddOne(blocal as b2)
blocal = blocal + 1
xputarg 1,blocal
End Procedure
In the above example, the caller is passing an unformatted variable (REC) to the AddOne() function, but the function is expecting to receive a B2 binary. Previously, blocal would have received the equivalent of val(REC), which was probably useless. Now blocal gets set from the first 2 bytes of the passed REC, which is effectively the same as setting blocal = BVAL.