John,
I have watched this conversation with interest and I'm sure that I have much
to contribute.
But a couple of observations.
1. You may need to "build" your command and then issue the &vcommand. You
know
SET VAR vinitval TEXT=.VSUPPLIER_TMP
SET VAR vcommand TEXT =
('CHOOSE vorder_notxt FROM #VALUES FOR ...... INITVAL ' + .vinitval)
&vcommand
2. Why don't you try building a form and using a VARIABLE LIST VIEW and
issue PROPERTY commands?
Jan
-----Original Message-----
From: "John Docherty" <[email protected]>
To: [email protected] (RBASE-L Mailing List)
Date: Fri, 12 Jun 2015 17:02:56 +1200
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with
computedvariables
Javier,
Thanks, yes I have checked with TRACE. The values are all TEXT.
I can make this work if I use one or the other fields (CTXT(order_no) or
supplier) but not when I combine them, which is what I was trying to do.
However it is strange, (at least to me), that I can select the row at the R>
using the INITVAL variable and the ‘combined column’ but the db
doesn’t seem to create a ‘match’ in the CHOOSE command.
Thank you.
Regards,
John Docherty
From:[email protected] [mailto:[email protected]] On Behalf OfJavier
Valencia
Sent: Friday, 12 June 2015 4:17 p.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with
computedvariables
John
Have you tried TRACEing your code to make sure your variables have the
correct type?
If I recall correctly, values for Properties and Options need to be text.
Javier,
>From my Android phone on T-Mobile. The first nationwide 4G network.
-------- Original message --------
From: John Docherty <[email protected] [mailto:[email protected]]>
Date: 06/11/2015 9:59 PM (GMT-06:00)
To: [email protected] [mailto:[email protected]]
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed
variables
Buddy,
This works
SET VAR vinitval TEXT=.VSUPPLIER_TMP
CHOOSE vorder_notxt FROM #VALUES FOR +
(SUPPLIER), order_no +
FROM orders WHERE sno=.vsno ORDER BY supplier +
CHKBOX 1 TITLE 'Order Number & Supplier' +
CAPTION 'CHOOSE Order Number To Change' +
LINES 20 +
FORMATTED +
OPTION +
INITVAL &VINITVAL
But if I create a column (order_choose) in the table to match the calculated
selection variable I was using (Supplier and the order no) it doesn’t.
However if I select the row from the table at the R> based on the variable
vinitval and the computed column the correct row is selected.
R>sel order_no from orders where order_choose=.vinitval
order_no
----------
888
Maybe I am missing something here but I am not sure what it is....
Thanks for your help with this.
Regards,
John Docherty
hvac asist ltd
hvac systems investigations solutions project management
64-27-433-2228
64- 3-312-6988
[email protected] [mailto:[email protected]]
-----Original Message-----
From: [email protected] [mailto:[email protected]] [mailto:[email protected]
[mailto:[email protected]]] On Behalf Of Buddy Walker
Sent: Friday, 12 June 2015 1:18 p.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Choose Command - Setting INITVAL with computed
variables
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]] [mailto:[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]] [mailto:[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]] [mailto:[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]] [mailto:[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]] [mailto:[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]] [mailto:[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