Information générale
Titre:
DIMENSION clear prior array elements
I have a piece of code that has been running without problem for some time now. I am exporting records from a table to an Excel file type using the COPY command. After this some code elsewhere is creating an array of the program stack using SYS(16) in a FOR...NEXT loop. Now this code (see below) is clearing all of the elements on each DIMENSION and only populates the last element because it is after the DIMENSION.
Has anyone ever seen or know what may be causing it. Nothing strange comes across through debugging and all of the code surrounding this looks ok to me. I have been coding for a long time and have never come across this one.
Lewis
Problem code:
PARAMETERS tuString, tlAll
EXTERNAL ARRAY tuString
LOCAL laStack[1], xx, llFound, lcProgram
FOR xx = 1 TO 128
lcProgram = SYS(16,xx)
IF EMPTY(lcProgram)
EXIT
ENDIF
DIMENSION laStack[xx] <<------- This clears array each time
laStack[xx] = upper(lcProgram)
ENDFOR
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement