[futurebasic] Re: [FB] scripting/back engines/passing params

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2000 : Group Archive : Group : All Groups

From: tedd@...
Date: Wed, 25 Oct 2000 10:23:07 -0400
jonathan:

>And it even crossed my mind that by passing the address of the string,
>rather than the string itself, it would be possible to return completely
>arbitrary data, in the space reserved for the string!

Instead of passing the address of the string (i.e., only 255 characters),
pass the address for a block of memory. Then have stored in the block of
memory all the variables/data you want. If you want to return
information/data, then set aside a block of memory (ie., gTheResultH&) for
all returns or include the return address in your call.

This reminds me of when I was working on the PMAP project (a MacAtlas type
program) where I not only passed the address of where the data was to work
on, but also the address of the function to work on the data with. In other
words, I created a linked list that contained two variables -- one was the
address of the function and the other was the address of the data for the
function to use. In that way, I simply called on the start of a linked list
to set into motion thousands of operations using large quantities of data
(i.e., draw all rivers within the confines of the data in memory).

You see, the data to draw the rivers were scattered throughout the entire
data file with only a 2-byte record designating that the following was
river data (in various forms). A scan through the entire data file would
pull out the river data records and place them into a linked list along
with the address of the specific function necessary to draw the data.
Please note that not all river data required the same function and hence
the need for specific functions. Once the linked list was made, then a
simple call to the start of the linked list would start the drawing
process. It was very elaborate in the making, but simple in the execution.

tedd

http://sperling.com/
_______________________________________________________
Thinking about buying Jewelry?
Try our site: http://earthstones.com