gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] UNSTRING with TALLYING


From: John R. Culleton
Subject: [open-cobol-list] UNSTRING with TALLYING
Date: Tue, 31 Oct 2006 13:16:31 -0400
User-agent: KMail/1.9.3

I get unexpected (by me) results with tihs clause. It appeard that the 
tallying begins with 0 and ends with n-1. Here is a snippet:
  MOVE 0 TO TALLYCOUNT.
           UNSTRING INREC DELIMITED BY "/" INTO
           STRING-AREA (1)    
           STRING-AREA (2)    
           STRING-AREA (3)    
           STRING-AREA (4)    
           STRING-AREA (5)    
           STRING-AREA (6)    
           STRING-AREA (7)    
           STRING-AREA (8)    
           STRING-AREA (9)    
           STRING-AREA (11)    
           STRING-AREA (12)    
           STRING-AREA (13)    
           STRING-AREA (14)    
           STRING-AREA (15)    
           STRING-AREA (16)    
           STRING-AREA (17)    
           TALLYING IN TALLYCOUNT.
           DISPLAY STRING-AREA (TALLYCOUNT).
-----------------------------------------------------------
I expect the DISPLAY to display the last string. Instead it displays the next 
to last string.  I can of course correct for this. But is this the expected 
behavior?  (TALLYCOUNT is defined as COMP btw.)
-- 
John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]