G'day Lucas,
The CHOOSE always returns a text value.
This is why it is important to reset the
var or clear it prior to the CHOOSE if
it is normally of a different data type.
After the CHOOSE one sets a new var to
the integer value of the text var or
converts the TEXT var to INTEGER,
depending on one's coding style or
preference.
SET VAR vChooseVar TEXT = NULL
>CHOOSE varname +
> FROM #VALUES +
> FOR (expression),retcol +
> FROM tblname +
> WHERE clause +
> AT scrnrow,scrncol +
> TITLE 'title' +
> CAPTION 'text' +
> LINES n +
> FORMATTED
IF vChooseVar IS NULL THEN
RETURN
ENDIF
SET VAR vResident INT = (INT(.vChooseVar))
At 13:36 29/04/02 +1000, you wrote:
>Please someone correct me here.
>I'm assuming the syntax for CHOOSE is as follows:
>
>CHOOSE varname FROM #VALUES FOR (expression),retcol FROM tblname WHERE
>clause AT scrnrow scrncol TITLE 'title' CAPTION 'text' LINES n FORMATTED
>
>Where retcol is the value returned to varname and can be an integer, text,
>whatever.
>
>If this is the case can anyone please explain to me why the following code
>returns a text value?
>
>CHOOSE vresident FROM #VALUES FOR ((LJS((CTXT(IDNO)),6)) & LASTNAME &
>FIRSTNAME),IDNO +
> FROM CLIENT WHERE LASTNAME LIKE .vsearch AND STATUS NOT IN ('OWL') +
> AND COURID LIKE .vuser ORDER BY LASTNAME AT 8,25 TITLE 'Choose
> Residents' +
> CAPTION 'Resident' LINES 20 FORMATTED
>
>Where CLIENT.IDNO is a unique integer.
>
>After the CHOOSE, vresident = ((LJS((CTXT(IDNO)),6)) & LASTNAME & FIRSTNAME)
>In fact, if I declare vresident INTEGER = NULL then Rbase returns an error.
>????????????????
>I'm using 6.5++ 1.851xRT03
>
>Thanks anyone.
>Lucas Edwards
>Information Systems
>Wesley Mission Brisbane
Warmest regards,
Tom Grimshaw
coy: Just For You Software
tel: 612 9552 3311
fax: 612 9566 2164
mobile: 0414 675 903
post: PO Box 470 Glebe NSW 2037 Australia
street: 3/66 Wentworth Park Rd Glebe NSW 2037
email: [EMAIL PROTECTED]
web: www.just4usoftware.com.au
the most needed product in the world can be found at
www.thewaytohappiness.org
This email and any files transmitted with it are confidential to the
intended recipient and may be privileged. If you have received this email
inadvertently or you are not the intended recipient, you may not
disseminate, distribute, copy or in any way rely on it. Further, you should
notify the sender immediately and delete the email from your computer.
Whilst we have taken precautions to alert us to the presence of computer
viruses, we cannot guarantee that this email and any files transmitted with
it are free from such viruses.
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/