Hello,
I've stumbled upon this phenomenon while writing tests with PBUnit. For illustration purposes, I isolated it as follows.
Create two global functions:
global function integer f_set_string (integer ai_in, ref string as_out);
if ai_in = 1 then as_out = 'one' else as_out = 'two'
return ai_in
end function
global subroutine f_show_string (string as_string, integer ai_int);
messageBox( 'Result', as_string + ' - ' + string(ai_int))
end subroutine
And then run the following script:
string ls_str
f_show_string( ls_str, f_set_string( 1, ls_str))
f_show_string( ls_str, f_set_string( 2, ls_str))
In my environment (PB 2019 R3 2728), I get this:
I must admit, it came as a surprise, and I don't think I've seen this before. Is it documented somewhere and I simply forgot PowerScript basics? :)
Best regards,
Konstantin
Andreas.
C# (left to right)
https://stackoverflow.com/questions/7359996/are-parameters-evaluated-in-order-when-passed-into-a-method
C++ (unspecified)
https://stackoverflow.com/questions/2934904/what-is-the-order-of-evaluation-for-function-arguments