John
Sorry, I can't test these for you but try one more thing.
SET VAR voption = ('OPTION INITVAL' & ( (LJS(.vsupplier_tmp,20) &
RJS(CTXT(.vorder_no),10))) )
Now after FORMATTED &voption
If the that don't work eliminate FORMATTED from the command
Buddy
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of John Docherty
Sent: Thursday, June 11, 2015 7:54 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed
variables
Buddy,
Thanks for that - I have just tried your suggestion both with a dotted
variable and an & variable in the CHOOSE command - still no luck.
Regards,
John Docherty
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Buddy Walker
Sent: Friday, 12 June 2015 11:17 a.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed
variables
John
If there is a space in your first value maybe you have to enclose the whole
vinitval in quotes
SET VAR vquotes = (CVAL('QUOTES))
SET VAR vinitval = .vquotes + ( (LJS(.vsupplier_tmp,20) &
RJS(CTXT(.vorder_no),10))) + .vquotes
Buddy
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of John Docherty
Sent: Thursday, June 11, 2015 6:02 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed
variables
Buddy,
Thanks for your reply. (The value for vsno is set elsewhere.)
I have tried many ways to see if I can get this to work, including just using
the order number, (in both the list and the INITVAL, as both a text and integer
value) all to no avail. I have run the sample provided by Razzak in my db -
that works correctly, (as expected) but unfortunately my version does not.
As I say I am not sure what I am missing with this. Any suggestions are
welcome.
Thank you.
Regards,
John Docherty
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Buddy Walker
Sent: Friday, 12 June 2015 9:29 a.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed
variables
John
I didn't notice a value for variable vsno
Have you tried doing the CHOOSE with actual values in place of the variables
to see if it works that way.
Buddy
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of John Docherty
Sent: Thursday, June 11, 2015 4:36 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed
variables
Razzak,
I am still struggling with this. If you have time to have a quick look over my
code and let me know if you can see what I am doing wrong, that would be much
appreciated. (I have modified this slightly while I try to make this work so I
can run it from the editor rather than from a form.)
CLEAR VAR vorder_no, vsupplier_tmp,vorder_notxt SET VAR vorder_no INTEGER =111
[This is usually set outside the EEP] SET VAR vsuppl_no=suppl_no IN orders
WHERE order_no=.vorder_no AND sno=.vsno SET VAR vsupplier_tmp=supplier IN
suppliers WHERE suppl_no=.vsuppl_no SET VAR vinitval=((LJS(.vsupplier_tmp,20) &
RJS(CTXT(.vorder_no),10))) SHOW VAR vINITVAL
CHOOSE vorder_notxt FROM #VALUES FOR +
((LJS(supplier,20) & RJS(CTXT(order_no),10))),order_no + FROM orderx WHERE
sno=.vsno ORDER BY supplier + CHKBOX 1 TITLE 'Order Number & Supplier' +
CAPTION 'CHOOSE Order Number To Change' + LINES 20 + FORMATTED + OPTION INITVAL
&vinitval
Thank you. I would be grateful for any help.
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
www.rbaseX.com
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]> 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