arrays > 64k

umm, when it comes to variables i always have problems...
what's wrong with this program (just an example of the problem i'm having right now)?
[CODE]
PROGRAM ScreenArray;
TYPE
tSpalte = ARRAY[0..479] OF Byte;
VAR
Screen : ARRAY[0..639] OF ^tSpalte;
i, j : Word;
BEGIN
FOR i := 0 TO 639 DO
FOR i := 0 TO 479 DO
Screen[i]^[j] := 0
END.
[/CODE]

Thanks
[ITALIC][B]chobo[/B][/ITALIC]

Comments

  • : umm, when it comes to variables i always have problems...
    : what's wrong with this program (just an example of the problem i'm having right now)?
    : [CODE]
    : PROGRAM ScreenArray;
    : TYPE
    : tSpalte = ARRAY[0..479] OF Byte;
    : VAR
    : Screen : ARRAY[0..639] OF ^tSpalte;
    : i, j : Word;
    : BEGIN
    : FOR i := 0 TO 639 DO
    : FOR i := 0 TO 479 DO
    : Screen[i]^[j] := 0
    : END.
    : [/CODE]
    :
    : Thanks
    : [ITALIC][B]chobo[/B][/ITALIC]
    :
    Try this:
    [code]
    type
    PSpalte = ^TSpalte
    tSpalte = ARRAY[0..479] OF Byte;
    VAR
    Screen : ARRAY[0..639] OF PSpalte;
    i, j : Word;
    BEGIN
    FOR i := 0 TO 639 DO begin
    Screen[i]:=new(PSpalte);
    FOR i := 0 TO 479 DO
    Screen[i]^[j] := 0
    end;
    END.
    [/CODE]


  • thanks, that was exactly the solution for my problem.
    now i got a new one: with your code i get runtime error 203: heap overflow. what can i do against it?


  • : thanks, that was exactly the solution for my problem.
    : now i got a new one: with your code i get runtime error 203: heap overflow. what can i do against it?
    :
    :


    Don't make such large structure or try another
    compiler (32-bit one...).


    Iby


  • : thanks, that was exactly the solution for my problem.
    : now i got a new one: with your code i get runtime error 203: heap overflow. what can i do against it?
    :
    :
    A way around this problem is not to use the conventional memory for your data, but the EMS-memory (TEMSStream) for it. Then simply copy a block of data into the conventional memory to process it and copy it back to update your data.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories