I suspect you are putting the cow pie before the cow. Even if what I suspect
you are trying to do worked, you would only see a bunch of numbers with
nothing to tie them to the record key.

>From the command prompt enter the statement yourself and then 
SAVE-LIST XYZZY 

Then EDIT-LIST XYZZY to see the data you are working with.

Provided that FLAG S/N MINQOH MAXQOH REOQOH QOH QIH QOO are all actual
elements of the RM file and not computed fields you are better off selecting
just the IDS, reading the RM file, extracting, and printing the data.

If you need to work with the list as written then you'll need something like
this:

NbrFieldsSelected = 8
LOOP
 ITM = ""
 FOR I = 1 TO 8
  READNEXT Datum ELSE BREAK
  ITM<I> = Datum
 NEXT I
 PRINT ITM<1>:... etc.
REPEAT

Oh and none of the selected fields better not be null :-)









-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of ww
Sent: Wednesday, June 03, 2009 8:54 AM
To: jBASE
Subject: Re: Reading Item From A List?


Dan

I still get the same result when I assign each item to a variable. Am
I missing something?

006     INCLUDE NEW.BP INIT.COMMON
007
008     OPEN 'RM' TO RM ELSE CRT 'CANNOT OPEN RM FILE';STOP
009
010     STMNT = 'SELECT RM WITH S/N = "STOCK" AND WITH FLAG NE "OUCH"
AND WITH NO.CHANGE = "" FLAG S/N MINQOH MAXQOH REOQOH QOH QIH QOO'
011
012     EXECUTE STMNT CAPTURING JUNK RTNLIST OUCHLIST
013
014     LOOP
015       READNEXT ITM FROM OUCHLIST ELSE EXIT
016       I1 = ITM<1>
017       I2 = ITM<2>
018       I3 = ITM<3>
019       PRINT I1:" ":I2:" ":I3
020     REPEAT
021
022     STOP
023
024

STOCK
0
0
0
0

0

STOCK
0
1
0
0
2
12

STOCK
0
0
0
2

0

STOCK
0
3
0
5
3
0

STOCK
0
0
0
1

0

On Jun 2, 8:23 pm, Daniel Klein <[email protected]> wrote:
> xx = ITM<1>etc...
>
> Dan
>
>
>
> On Tue, Jun 2, 2009 at 2:45 PM, ww <[email protected]> wrote:
>
> > The following code always prints items down the screen as shown toward
> > the end of this post. How do I capture each ITM value to a variable so
> > I can use them in a calculation later?
>
> > Thanks in advance,
>
> > INCLUDE BP INIT.COMMON
> > OPEN 'RM' TO RM ELSE CRT 'CANNOT OPEN RM FILE';STOP
>
> > STMNT = 'SELECT RM WITH S/N = "STOCK" AND WITH FLAG NE "OUCH" AND WITH
> > NO.CHANGE = "" FLAG S/N MINQOH MAXQOH REOQOH QOH QIH QOO'
>
> > EXECUTE STMNT CAPTURING JUNK RTNLIST THELIST
> >   LOOP
> >      READNEXT ITM FROM THELIST ELSE EXIT
> >      PRINT ITM<1>:" ":ITM<2>:" ":ITM<3>
> >   REPEAT
> > STOP
>
> > STOCK
> > 0
> > 3
> > 1
> > 9
>
> > 8
>
> > STOCK
> > 0
> > 3
> > 1
> > 14
>
> > 0
>
> > STOCK
> > 0
> > 2
> > 1
> > 22
>
> > 0- Hide quoted text -
>
> - Show quoted text -



--~--~---------~--~----~------------~-------~--~----~
Please read the posting guidelines at: 
http://groups.google.com/group/jBASE/web/Posting%20Guidelines

IMPORTANT: Type T24: at the start of the subject line for questions specific to 
Globus/T24

To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to