|
I want to thank Carsten Flensburg and Scott Klement for their
invaluable help. I realise now that my confusion was not
understanding how ALLOC works with pointers.
I understood that pointers do not reserve memory,as such, so
I did not understand how one can use ALLOC and have a pointer
to the reserved memory. Carstens example allowed me to see
the light. I have snipped parts of Carstens code to illustrate.
Another issue I did not understand is 'based' variables
and in this case based data structures.
I was under the mistaken impression that I needed to set
a pointer then move data from/to program variables.
The simplicity of just changing the pointer value and
viola the data is available to you in the variable escaped me.
Alloc and Realloc I am now, at last, able to understand and use.
The epiphany experience is a high that I cannot repay.
The best I can do is say thanks and it is a joy to learn from
the masters.
Frank Kolmann
----- SNIP ---------------
Code from Carsten Flensburg
**-- Journal information:
D RJRN0100 Ds Based( pJrnInf )
D RjBytRtn 10i 0
D RjBytAvl 10i 0
D RjOfsKeyInf 10i 0
D RjJrnNam 10a
D RjJrnLib 10a
D RjASP 10i 0
----- SNIP ------------
ApiRcvSiz = 10240;
pJrnInf = %Alloc( ApiRcvSiz );
DoU RjBytAvl <= ApiRcvSiz;
If RjBytAvl > ApiRcvSiz;
ApiRcvSiz = RjBytAvl;
pJrnInf = %ReAlloc( pJrnInf: ApiRcvSiz );
EndIf;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.