[fpc-devel] porting from fpc to tp7
Daniël Mantione
daniel.mantione at freepascal.org
Sat Mar 24 13:52:20 CET 2007
Op Sat, 24 Mar 2007, schreef Evgeniy Ivanov:
> > Well, all I can say is check your code securely. The basic idea is good,
> > so it is likely the implementation.
> I will try. May be there is some problem with index and memory in tp and dos
> (dos emulation in NT) is unsecure.
Note that in Dos, the memory at program start is in random state; in other
words, if your program contains bugs like uninitialized memory, it can
have different behaviour between runs.
>
> > Also, is your array really 1-based?
>
> Hm... I didn't understand. I have such definitions of my array:
>
> type dynamic_array = array[1..buf_count] of BusStation; //BusStation is
> record with 4 strings
> dynamic_array_ptr = ^dynamic_array;
> var
>
> list:dynamic_array_ptr; // it's my "dynamic array" with its size counter
> list_count:Integer;
> ...
> // How I use it:
> for i:=1 to num_of_strings do
> begin
> if i > list_count then
> add_mem(list,list_count);
This is okay if everything is 1-based. If it is 0-based, you need to be
carefull in getmem to allocate memory for the 0th element too.
> I herd that there were problems with dos games: sometimes they started not
> from the beginning, but from last time ending.
No idea.
Daniël
More information about the fpc-devel
mailing list