>To: scoug-help@scoug.com
>Subject: SCOUG-Help: ASK.exe ?
> __________________________________________________________________
>
>
>=====================================================
>If you are responding to someone asking for help who
>may not be a member of this list, be sure to use the
>REPLY TO ALL feature of your email program.
>=====================================================
>
>I need an ASK command that I can use in a non-REXX command file.
OK, this runs *in* a *non-REXX* command file:
--
/* ReXX */
/* ASK.CMD
04 Jan. 2003
per question by Peter Skye
USAGE: ASK answers "The question: "
*/
PARSE ARG answers question ;
question = Strip( question ) ;
question = Strip( question, 'BOTH', '"' ) ;
/* May desire to comment this out if you load RexxUtils on boot or
elsewhere: */
CALL LoadThem ;
CALL CharOut 'STDOUT', question, ;
DO UNTIL 0 < index
theone = SysGetKey( 'NOECHO' ) ;
index = Pos( theone, answers ) ;
END ;
CALL CharOut 'STDOUT', theone, ;
CALL Value ERRORLEVEL, index, 'OS2ENVIRONMENT' ;
EXIT index
LoadThem:
CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' ;
CALL SysLoadFuncs
RETURN ;
--
>
>ASK (or some similar name) typically has a syntax like:
>
> ASK CHOICES "Message"
>
>and the program displays "Message" on the screen and then waits for the
>user to enter one of the characters in CHOICES. The entered character's
>position in the CHOICES string becomes the Return Code (ERRORLEVEL)
>returned by the ASK.exe program.
>
>For example,
>
> ASK YNQ "Answer Y(es) or N(o), Q to Quit"
>
>would display this on the screen:
>
> Answer Y(es) or N(o), Q to Quit _
>
>and the user may enter Y, N or Q resulting in a Return Code of 1, 2 or
>3.
>
>I found ASKIT on Hobbes but it requires two of the screen lines in a
>command line window -- one for the message and one for the response --
>and I'd much prefer to have a single-line solution.
>
>Anybody know where I can find such a program?
>
>- Peter
>
>
>
>=====================================================
>
>To unsubscribe from this list, send an email message
>to "steward@scoug.com". In the body of the message,
>put the command "unsubscribe scoug-help".
>
>For problems, contact the list owner at
>"rollin@scoug.com".
>
>=====================================================
>
>
> [spacer.gif]
> [spacer.gif] [50][image_mime_mail.gif] [view source]
>
> [51]Move To [52][(1)__Select Folder:.]
>
> [53]<< Prev [54]Reply [55]Reply All [56]Forward [57]Delete
> [58]Next >>
> __________________________________________________
>
> [59]Copyright (c) 2002 EarthLink, Inc.
--
Regards,
Dallas E. Legan II / leganii@surfree.com / dallasii@kincyb.com
Powered by......Lynx, the Internet at hyperkinetic speed.
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 04 |
January |
2003 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.