[Coco] Expert C programmer wanted
John R. Hogerhuis
jhoger at pobox.com
Fri Feb 11 19:02:29 EST 2005
On Fri, 2005-02-11 at 16:01 -0500, KnudsenMJ at aol.com wrote:
>
> Is Pascal like Basic09, in that functions can't return values? If not, then
> you should be able to return a single value (a success/error code for
> example).
Functions in Pascal must return a value, IIRC.
>
> Otherwise, can you use the Basic09 trick (also handy in C), where you pass
> the function the address of a structure ("type" in Basic09), an let the
> assembler OS9 routine fill in the slots/fields of the structure/type with multiple
> return values?
>
> Or maybe pass the address of one or more Pascal variables, into which the
> OS9 assembler routine can store values?
>
> Now, ISTR that Pascal didn't allow pointers or addresses (thus guaranteeing
> that C would play the part of Mammals to Pascal's Dinosaurs). But I'm pretty
> sure Pascal has structures (user-defined types as in Basic09), and when one
> is passed to a routine, it *probably* is passed by reference (address, or
> pointer (shhhh)), so if the routine changes any fields/members of the structure,
> those changes will be seen afterwards in the calling program.
Even standard pascal has pointers. And I think var parameters are
standard too (pass by reference).
More information about the Coco
mailing list