|
|
Wasn't it gregjohn who wrote:
>What's the smartest SDL coding option to replace what might have been done
>with persistent variables?
>
>1) Recalculating the events of frames 1 to n-1 for every nth frame;
>
>2) writing to disk each time there's an event that needs to be remembered.
Which one is smartest depends on how long it takes to calculate the
changes from one frame to the next.
If the calculations are quick, recalculate each time. Once you know how
to calculate one frame it's easier to write a simple loop round the
calculation than to add file handling.
If the calculations are slow, write to disk.
>Q: What happens however upon each re-opening of a file-- will the old
>material that's in the file be discarded, or are newly written records
>appended at the end?
The #fopen command has a "write" option which zaps any existing data,
and an "append" option which appends the data to the end.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|