This is about scope. AppGameKit Basic now allows call by reference as well as call by value.
Call by value is how you declared Orbiting(). When something is passed by value a copy of the thing you have passed is created inside the function, and any changes you make are lost when the function exits, and the original is left unchanged. Call by value is the default in most computer languages.
Call by reference means that you are actually working on the original, not a copy, and anything you change is changed in the original.
function Orbiting(Orbitname ref as typeOrbit)
This is a powerful feature which brings AppGameKit Pascal into line with more advanced languages. But use it with caution - if you are careless you can screw up vital data.
It should be impossible to pass a constant as a ref parameter, but I haven't tried it!
When to use call by value:
Most of the time. You want to do some operation on the data passed and do something else with it without changing the original. (The AppGameKit Basic help file examples are wrong about function return values in some cases, actually).
When to use call by reference:
When you really
do want to change the original data. You will do this infrequently, and often when you want to change several fields in one go, since functions can only return one result.
-- Jim - When is there going to be a release?