FB II COMPILER
Pass a record to a local function
You can pass integers, strings, and floats to a function as parameters, but FB does not let you pass the entire record.
"Parameter block" is a Mac toolbox term. It is a record that refers to one entity - a serial port, a file, a folder. You can pass the same record to a series of Toolbox calls; they use the record to communicate with each other and to store the current information about the file.
Inside a funtion, to copy an entire record at once, use this syntax:
This means: copy the number of bytes specified in _myRecordSize (which must be a constant) from the variable AdressOfRecord& points at, into NewRecord.
If you like to save typing, here's a technique that Staz sometimes uses in their code snippets:
It takes longer, but I imagine the extra time wouldn't be noticeable if your loop isn't too large. It's also good for putting strings in records, since you don't have to go back and automatically insert the length byte yourself.