Re: PROMPT( 4GL)
Posted in 1998
On Tue, 15 Dec 1998, AJAYP wrote: > Hi all, > Is there any way in which I can ensure that users enter only a specific > set of values and reject all other entries ? > I am using INFORMIX-4GL Version 7.20.UD4X1 and running Informix 7.30 ODS. > TIA, > Ajay > > You could try making a function which you pass the information you want. Something like this function prompt_user(Mline,Mphrase,Mvalid,Mchar) define Mline smallint, Mphrase varchar(75), Mvalid varchar(80), Mchar char(1), Manswer varchar(20) let int_flag=false let Mvalid="[",Mvalid,"]" if Mline>0 then options prompt line Mline end if let Manswer=null while Manswer not matches Mvalid or Manswer is null # this is for determining weather you want to prompt for a character or a string if Mchar="Y" then prompt Mphrase clipped for char Manswer else prompt Mphrase clipped for Manswer end if let Manswer=upshift(Manswer) end while #if you change your prompt line you will have to set it back to whatever you # had it originally return Manswer end function ------------------------------------------------------------------------- Joseph Cullipher <joseph@cannonexpress.com> Standard Disclaimers Apply -------------------------------------------------------------------------