Steve
  The statement does the same thing as the SET VAR vpon = pon ..... but
it is more in line with SQL standards. 

  SELECT columname INTO variablename INDICATOR iv1 FROM ....

 SELECT the value from columname and put the value into this
variablename

You need the INDICATOR just in case the column value is null. This
prevents an error.  The other thing about this is that the select is
expecting only one row.

 You can get more information from help "select into"

Buddy


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Steve
Breen
Sent: Monday, April 26, 2010 9:43 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: while loop issue

Buddy,

 

You are going to laugh at me but I have been doing this for a while as
needed and am not good but decided I like this. Started back to college
to get a programming degree and just confused languages. Forgot in RBase
you need the "then".

 

 

Next please explain what the following does. I like to understand
things. 

 

SELECT pon INTO vpon INDIC IV1 FROM master WHERE pon = .vpo_number

 

Thanks for your time and thanks for the help.

 

Steve

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Walker,
Buddy
Sent: Monday, April 26, 2010 9:04 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: while loop issue

 

Steve

 

   You need QUIT in quotes and THEN at the end of the WHILE line

 

   While vpo_number <> QUIT 

 

   Should be

 

  While vpo_number <> 'QUIT' THEN

 

 

  Don't clear variables inside while loops set them to null

 

CLEAR VAR vpon

 

Should be 

 

SET VAR  vpon = NULL

 

CLEAR VAR vpo_number 

 

Should be

 

SET AR vpo_number = NULL

 

Even though 

 

SET VAR vpon = pon FROM master WHERE pon = .vpo_number 

 

I would change it to

 

SELECT pon INTO vpon INDIC IV1 FROM master WHERE pon = .vpo_number

 

Buddy

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Steve
Breen
Sent: Monday, April 26, 2010 8:51 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - while loop issue

 

Told you it has been a long day

Here it is as I have it now

Sorry

 

Note vpo_number is text

While vpo_number <> QUIT

-- 1PRINT AP_Internal_Detail WHERE pon = .vpo_number +

-- 1OPTION PRINTER 

-- +

-- |DUPLEX HORIZONTAL +

-- 1|COLLATION ON +

-- 1|COPIES 1 +

-- 1|ORIENTATION PORTRAIT +

--   |PRINTER_NAME \\rsd01\RICOH Aficio SP 8100DN PCL6

LABEL loop1

CLEAR VAR vpo_number

DIALOG 'Enter A CDI Job# or ESC to exit (AP_Internal_Detail):'
vpo_number=10 vkey 1

IF vkey = '[esc]' THEN

  GOTO finish

ENDIF

 

IF vkey = '[enter]' AND vpo_number IS NULL THEN

  RUN errmsg.rmd USING 'No PO# Number Entered - Press Any Key to Enter
One'

  GOTO loop1

ENDIF

 

CLEAR VAR vpon

SET VAR vpon = pon FROM master WHERE pon = .vpo_number

IF vpon IS NULL THEN

  RUN errmsg.rmd USING 'CDI Job# Not found'

  -- GOTO loop1

ENDIF

endwhile

 

LABEL finish

 

RETURN

 

 

 

Stephen 

--- RBASE-L
=======================3D=======================3
D=
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
=======================3D=======================3
D=
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
=======================3D=======================3
D=
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
=======================3D=======================3
D=
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
=======================3D=======================3
D=


Reply via email to