Thank you all for your responses. It is our first time with Dynamic variables.
We have a 15000 buffer containing formatted XML data that we are passing backto a server. In earlier versions of Natural we could not have a buffer this size, so we redefined it into 60 buffers of 250 bytes.
In the calling program, we do not use EXPAND, RESIZE or REDUCE. We are continuing compressing data into this dynamic varriable #XML-TEMP. When we are finished with all our compressions we call this copycode, when we are ready to move the buffer to another buffer. It is only called one time at the end of the calling program.
It did do a test where I just coded
#XML-LEN := *LENGTH(#XML-TEMP)
MOVE SUBSTRING(#XML-TEMP,1,#XML-LEN) TO #SEND-AREA
Could this replace our copycode ? Do we need to do a ‘free’ of memory at the end? If so what is the code?
If we continue to compress into the same dynamic variable, does it expand every time, and this use more processing time?
How is the best way to use EXPAND, SIZE, RESIZE
Thanks for your help.
The input variables are defined as below in an LDA format:
1 #RECEIVE-AREA A 1 (15000)
R 1 #RECEIVE-AREA /* REDEF. BEGIN : #RECEIVE-A
2 #RECEIVE-BUFFER A 250 (60)
R 1 #RECEIVE-AREA
2 #TRANS-ENVIR A 1 /* D=DEV, Q=QA, P=PROD
2 #TRANS-CODE A 5
1 #SEND-AREA A 1 (15000)
R 1 #SEND-AREA /* REDEF. BEGIN : #SEND-AREA
2 #SEND-BUFFER A 250 (60)
The other variables as defined in a LDA are
1 #XML-LEN N 5
1 #XML-START-IDX N 5
1 #XML-STOP-IDX N 5
1 #XML-LINE N 3 INIT<1>
1 #X N 3
1 #ERROR-CODE N 2
1 #D-QUOTE A 1 INIT
1 #VALUE-TO-ADD A 200
1 #TAG-NAME A 20
1 #TABLE-KEY-2 A 35
1 #TABLE-KEY-2 /* REDEF. BEGIN : #TA
2 #TBL-KEY-2-NUM A 3
2 #TBL-KEY-2-DATA A 32
1 #XML-TEMP A DYNAMIC
1 #XML-MISC-TEXT A DYNAMIC