Yes, but your line

IF a2 = -1 THEN
  -- Turn something red

could just as easily (and, IMHO, more clearly) read:

IF aZMainMD IS NULL THEN
  -- Turn something red

--
Larry


________________________________
 From: Tom Frederick <[email protected]>
To: RBASE-L Mailing List <[email protected]> 
Sent: Wednesday, May 16, 2012 11:55 AM
Subject: [RBASE-L] - Re: Difference between "select into" and "set var"
 

I use those INDIC vars all the time in Custom Form Actions for EXIT commands to 
make sure a form is filled out correctly. In the example below if a2 =  -1, the 
EEP has code which turns that field RED and the user cannot leave the form 
until they put in the missing info and a2 = 0. Some forms have 40 separate 
INDIC lines. CLEAR VAR a% when the form ends cleans up the vars.  
 
SELECT                                                                      +
   ZLastPhysExam, ZMainMD, ZSecondMD +
   INTO                                                                       +
   aZLastPhysExam   INDICATOR a1,               +
   aZMainMD              INDICATOR a2,               +
   aZSecondMD         INDICATOR a3                 +
   FROM Z_Medical_Info  WHERE (ZID = .vZID)
RETURN
 
Tom Frederick
President/CEO
Elm City Center
1314 W Walnut
Jacksonville, IL  62650
W- 217-245-9504
F - 217-245-2350
E - [email protected]
 
From:[email protected] [mailto:[email protected]] On Behalf Of Bill Downall
Sent: Wednesday, May 16, 2012 10:20 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Difference between "select into" and "set var"
 
Karen,
 
Even briefer, because the IND keyword is optional, and why number your 
indicator variable if you are going to use the same one over and over:
 
     SELECT column1, column2, column3 
       INTO vColumnVar1 iv, vColumnVar2 iv, vColumnVar3 iv
 
Bill


On Wed, May 16, 2012 at 11:13 AM, <[email protected]> wrote:
Albert:  I hear ya!  I'm probably a bit OCD on wanting to see the
least amount of code necessary to do the task.  And when I see
someone's code like this:
    select column1, column2, column3 into
        vColumnVar1 INDICATOR vColumnVar1Indicator,
        vColumnVar2 INDICATOR vColumnVar2Indicator ....
and then they never use the indicators for anything, it drives me crazy!
What's wrong with
     select column1, column2, column3 into
        vColumnVar1 IND iv1, vColumnVar2 IND iv1

Karen

Reply via email to