Sorry but this code does not work everywhere as public should be global However, I consider this as bad practice for a lot of reasons. If you need to pass variables to a function then use the regular function expression as in every language:
function myfunction($vara, $varb, ...) {}
call it by using
$myval = myfunction(12, 3);
The global variables between [] are used to store data in a global way which is needed to pass variables between several scriptcase applications (php modules). It stores the data into a public pool. If you switch between applications the standard way (menus) then this works well. If you need to redirect it might be necessary to pass the global variables yourself like in:
[glob_myglobal]=“somevalue”;
or
sc_redir(myapp.php,glob_myglobal=“somevalue”, _parent)
In the last situation the glob_myglobal is send to the myapp where it will be accessible using []. Don’t use [] in the sc_redir macro. (bit confusing, but it’s as it is).
hope this helps.