You should also test for vChooseVar = 'Help'. The F1 key will always return the values 'Help'.
Troy ===== Original Message from [EMAIL PROTECTED] at 4/29/02 8:20 pm >Thanks Sami, > >Comes from typing quickly from memory. > >The actual code block I use from NoteTab says: > >IF vChooseVar IS NULL OR vChooseVar = '[ESC]' THEN > RETURN >ENDIF > >By setting the var to NULL prior to the CHOOSE and >testing its value afterwards it gracefully returns >to the calling block if there are no rows found >rather than crashing. > > > >> > IF vChooseVar IS NULL THEN >> > RETURN >> > ENDIF >> >>should be: >> IF vChooseVar = '[ESC]' THEN >> RETURN >> ENDIF > > >At 03:31 29/04/02 -0500, you wrote: >>Slight correction to your block of code. The lines: >> >> > IF vChooseVar IS NULL THEN >> > RETURN >> > ENDIF >> >>should be: >> IF vChooseVar = '[ESC]' THEN >> RETURN >> ENDIF >> >>Sami >> >>----------------------------------------------------------- >>Sami Aaron >>Software Management Specialists >>19312 W 63rd Terr >>Shawnee KS 66218 >>913-915-1971 >>http://www.softwaremgmt.com >> >> >>----- Original Message ----- >>From: "Tom Grimshaw" <[EMAIL PROTECTED]> >>To: <[EMAIL PROTECTED]> >>Sent: Monday, April 29, 2002 3:35 PM >>Subject: Re: CHOOSE syntax >> >> >> > 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/ >> > >> > >> > >> >> >>================================================ >>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/ > >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/ ================================================ 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/
