R:Style is your friend. Emmitt Dove Manager, Converting Applications Development Evergreen Packaging, Inc. [email protected] (203) 214-5683 m (203) 643-8022 o (203) 643-8086 f [email protected]
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Rachael Malberg Sent: Tuesday, April 27, 2010 08:28 To: RBASE-L Mailing List Subject: [RBASE-L] - RE: while loop issue oh trust me if you program in a couple different languages you'll experience this often with if and while statements. (I flip back and forth between RBase & PHP for 5 or so years now and will still have to double check my syntax and remember is the 'THEN' or the '{' one?!?!) So the statement... SELECT pon INTO vpon INDIC IV1 FROM master WHERE pon = .vpo_number means... select [field] into [variable name you want to store the field value in] indic [null value variable] from [table] where [field]=[pre set variable] I'll confess the 'indic [null value variable]' I never use because I will evalute the [variable name you want to store the field value in] is null or not so I'd use this... SELECT pon INTO vpon FROM master WHERE pon = .vpo_number if vpon is null then --do this for null else --do this if not null endif ~Rachael ----- Original Message ----- From: "Steve Breen" <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Monday, April 26, 2010 8:43 PM 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

