The mystery of the missing (compound) variables.



It's a mystery. What happened to the missing compound variable "array"
members in the last record ?

So I use a text file with a max 50 records as a number all alone on
its line (so I can recover it as a number) and a following space-
separated text string line which can be PARSEd. Code snippet:

IF STREAM(file,"C","QUERY EXISTS")\="" THEN DO
CALL STREAM file,"C","OPEN READ"

rec_num = 0

DO FILELN = 1 TO 50
IF STREAM(file,"S")\="READY" THEN
LEAVE
ln = LINEIN(file)
IF LEFT(ln,1) > 0 THEN DO
rec_num = rec_num + 1
array1.rec_num = ln
SAY "Rec Num "rec_num array1.rec_num
END
ELSE DO
PARSE VALUE ln WITH " "array2.rec_num" "array3.rec_num"
"array4.rec_num
/* displays records correctly */
SAY array2.rec_num array3.rec_num array4.rec_num
END
END

CALL STREAM file, "C", "CLOSE"
END

/* displays all records correctly EXCEPT FOR THE LAST RECORD (I.E.
WHEN THEY =.REC_NUM) */
SAY array2.rec_num array3.rec_num array4.rec_num

What happened to the last record which displayed correctly inside the
DO loop, but is missing outside it ?

This runs in ZOC with its Enterprise Alternatives Inc flavor of REXX.
Anyone with any clues to this dastardly outcome ?
.



Relevant Pages

  • Re: extract items from list in single field
    ... Try using the Splitfunction to change the delimited string into an array. ... You would then loop through the members of the array and write one record to ...
    (microsoft.public.access.modulesdaovba)
  • Re: Getting value from an array using another array
    ... If you show how you are accessing the members of p, ... You realise that is permanently modifying the array passed to the ... You can get rid of the not logic by re-arranging the loop: ... A little more robust, but not much. ...
    (comp.lang.javascript)
  • Re: mail() in a loop?
    ... Personally I would first scan the database, build an array of email addresses and then start sending messages. ... Tomorrow you might have 1000 users - create the email messages in the loop, spool them on the hard drive in some folder and then have a cron job who starts every 5 minutes pick the messages and send them. ... I have a simple discussion forum with about 100 members. ...
    (comp.lang.php)
  • Re: is it possible to access members of struct in loop?
    ... is it possible to access the members of a struct in a ... loop, comparable to an array? ... No (unless those 10 members happen to be an array!), ...
    (comp.lang.c)
  • Re: visibility matter on converting object to array
    ... i'll get an array having keys that from member variable's name ... i guessed "i can get public members but not protected, private, static ... Is it right way to access object members?(by converting to ...
    (comp.lang.php)

Loading