Razzak,

 

Thanks for your reply. I did try the second sample and that all worked as it 
should, but I couldn’t get it to work when I tried to use the same method on my 
table.  I will have another try soon. (Maybe I am missing something obvious 
here….?) 

 

Thank you.

 

Regards,

 

John Docherty

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of A. Razzak Memon
Sent: Thursday, 11 June 2015 7:33 p.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed 
variables

 

John,

Here's the definition and a few examples to understand the use of

INITPOS and INITVAL parameters for the CHOOSE command.

Once you understand the typical use, you should be able to adapt 

as you see fit.


INITPOS specifies the pre-selected initial position(s) for the items 
in the list. 

The first position in the list is assigned zero, and increments for 
the number of values in the list (0 = 1, 1 = 2, 3 = 4, etc).

INITVAL specifies the pre-selected initial value(s) for the items in 
the list. 

-- Example 01
IF (CVAL('DATABASE')) <> 'RRBYW18' OR (CVAL('DATABASE')) IS NULL THEN
   CONNECT RRBYW18 IDENTIFIED BY NONE
ENDIF
   SET VAR vTitle TEXT = 'Choose Table(s)'
   SET VAR vCaption TEXT = 'Using INITPOS Option in CHOOSE Command'
   SET VAR vChoose TEXT = NULL
   CLS
   CHOOSE vChoose FROM #TABLES CHKBOX 2 +
   TITLE .vTitle +
   CAPTION .vCaption +
   LINES 27 +
   OPTION INITPOS 2,5 +
   |WINDOW_BACK_COLOR WHITE +
   |TITLE_BACK_COLOR WHITE +
   |TITLE_FONT_NAME Tahoma +
   |TITLE_FONT_COLOR NAVY +
   |TITLE_FONT_SIZE 14 +
   |LIST_BACK_COLOR WHITE +
   |LIST_FONT_NAME Tahoma +
   |LIST_FONT_COLOR NAVY +
   |LIST_FONT_SIZE 12 +
   |BUTTONS_SHOW_Glyph ON +
   |BUTTONS_BACK_COLOR WHITE
IF vChoose = '[Esc]' THEN
   GOTO Done
ENDIF
   -- Do what you have to do here ...
LABEL Done
    CLEAR VARIABLES vTitle,vCaption,vChoose
    RETURN

-- Example 02
IF (CVAL('DATABASE')) <> 'RRBYW18' OR (CVAL('DATABASE')) IS NULL THEN
   CONNECT RRBYW18 IDENTIFIED BY NONE
ENDIF
   SET VAR vTitle TEXT = 'Choose Table(s)'
   SET VAR vCaption TEXT = 'Using INITVAL Option in CHOOSE Command'
   SET VAR vChoose TEXT = NULL
   CLS
   CHOOSE vChoose FROM #TABLES CHKBOX 3 +
   TITLE .vTitle +
   CAPTION .vCaption +
   LINES 27 +
   OPTION INITVAL Customer,InvoiceHeader,Titles +
   |WINDOW_BACK_COLOR WHITE +
   |TITLE_BACK_COLOR WHITE +
   |TITLE_FONT_NAME Tahoma +
   |TITLE_FONT_COLOR NAVY +
   |TITLE_FONT_SIZE 14 +
   |LIST_BACK_COLOR WHITE +
   |LIST_FONT_NAME Tahoma +
   |LIST_FONT_COLOR NAVY +
   |LIST_FONT_SIZE 12 +
   |BUTTONS_SHOW_Glyph ON +
   |BUTTONS_BACK_COLOR WHITE
IF vChoose = '[Esc]' THEN
   GOTO Done
ENDIF
   -- Do what you have to do here ...
LABEL Done
    CLEAR VARIABLES vTitle,vCaption,vChoose
    RETURN

Have fun!

Very Best R:egards,

Razzak.

www.rbase.com <http://www.rbase.com> 
www.rbaseX.com <http://www.rbaseX.com> 
www.facebook.com/rbase <http://www.facebook.com/rbase> 
-- 
32 years of continuous innovation!
17 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--

 

On Wed, Jun 10, 2015 at 11:52 PM, John Docherty <[email protected] 
<mailto:[email protected]> > wrote:

I have a CHOOSE command which allows the user to select an order number based 
on a calculated value which displays the Supplier & the Order number combined 
as a left & right justified field. I have tried to set the INITVAL to choose 
the current order being edited, but I cannot make this work, the INITVAL option 
being ‘ignored’.  The INITVAL is calculated using the same formula as the 
fields in the CHOOSE command.

 

I also tried other ‘options’, including just using the order number, but I 
couldn’t get that to work either.  (Sample DB obviously works OK in my db 
though.) 

 

As I assume that I am missing something here, if anyone has a working CHOOSE 
command sample, with the INITVAL being a calculated value, that they are 
prepared to share I would appreciate your help. 

 

Thank you.

 

Regards,

 

John Docherty

 

 

Reply via email to