Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_prompt() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_PROMPT()

 DESCRIPTION

 The C_PROMPT() function displays a data entry prompt to request
 information from the user.  The function uses Clipper's GET/READ
 command to control the data entry.  C_PROMPT() handles all of the
 positioning, screen saving, and box alignment to provide a quick
 method of retrieving data from the screen.  An optional character
 string can be displayed to the left or above the GET prompt to
 provide information to the user.

 NOTES

 The value entered by the user in C_PROMPT() is not identified by
 the getvar parameter passed to C_PROMPT(), but is returned by the
 function to the variable assigned.

 To disable the insert (INS) status and the block at the top, right
 of the screen, use the Clipper SET SCOREBOARD OFF command.

 SYNTAX

 C_PROMPT(row, col, getvar [,string] [,option] [,box] [,picture]
 [,valid] [,shadow])

 PARAMETERS

 row (N) is the starting row for the prompt.

 col (N) is the starting column for the prompt.  Specify a negative
 one (-1) to automatically center the prompt on the screen.

 getvar (C) is the variable to use for the GET.  The variable must
 be declared and initialized to the correct length and value, if
 any.  The getvar argument is the same type of GET variable used
 with a GET/READ.  Note that the value of the getvar variable is not
 changed by C_PROMPT().

 string (C) is the text to display above or beside the getvar input
 area.  If string is not specified, no text is displayed.

 option (N) indicates the location of the string argument.  Specify
 1 to place string to the left of getvar, or 2 to place string above
 getvar.  If option is not specified, the default of 1 (left) is used.

 box (N) is the type of box (0-5) to display.  The box types are as
 follows:  0=no box, 1=single box, 2=double box, 3=double top/single
 sides, 4=single top/double sides, and 5=Solid graphics.  If box is
 not specified, box type 2 (double) is used.

 picture (C) is the optional PICTURE clause expression to use with
 getvar.  The picture argument can be any Clipper PICTURE expression.

 valid (C) is the optional VALID expression to use with getvar.  The
 valid argument can be any Clipper VALID expression or function.

 shadow (N) is the type of shadow to display around the prompt.
 The shadow types are as follows:  0 = no shadow, 1 = left
 side/bottom shadow, and 2 = right side/bottom shadow.  If shadow is
 not specified, no shadow is displayed.

 RETURNS

 C_PROMPT() returns the contents of the getvar argument in whatever
 data type the variable was defined.  Note that the Clipper's
 LASTKEY() function can be used to determine the last key that was
 pressed in C_PROMPT().

 EXAMPLES

 && Display at 5,2 in a double box, with text "Enter Number" above
 && the prompt, with the picture "99,999.99", and no valid expression.
 && RETURN the new GET value entered in the variable "ans".

 mnum = 0
 ans = c_prompt(5,2,mnum,"Enter Number:",2,2,"99,999.99")


 && Display centered at row 10, with text "Enter Name" to the left
 && of the prompt using defaults of a double box and no picture or valid.
 && RETURN the new GET value entered in the variable "ans".

 mname = space(20)
 ans = c_prompt(10,-1,mname,"Enter Name:")


 && Display at 10,10 in a single box, with text "Enter Name" to the left of
 && the prompt, with the picture "@!", and the valid function "ck_read".
 && RETURN the new GET value entered in the same variable "mname".

 mname = space(20)
 mname = c_prompt(10,10,mname,"Enter Name:",1,1,"@!","ck_read()")

 **------------------**
 FUNCTION ck_read

 if empty(c_getvar())
   c_msg(20,1,3,2,"w+/r","A Name Must be Entered")
   return .f.
 endif
 return .t.


See Also: C_QINPUT() C_GETTEXT() C_GETVAR() C_READEMPTY()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson