_ask.utl Utility - Ask a Question
Syntax
call "_ask.utl",question$,answer${,length$,message$,
helpfile$,helpitem$,title$,column,row,control_value,
pad_character$,input_mask$,output_mask$,arguments$,
input_attributes$,output_attributes$,no_shadow,
box_internal_color$,box_border_color$,window_identifier,
scrolling_size,timeout,newline_character$,
column_character$}
Description
The _ask.utl utility prompts the user for input inside a windowed box. The optional parameters must be entered in the sequence listed below and may not be skipped; for example, helpfile$ must be preceded by length$, and message$, etc. However, null values can be entered for strings and 0s for numerics to use system defaults. The option string can be truncated.
Parameter |
Description |
question$ |
Prompt string. |
answer$ |
The value passed in this variable is used as the default. The input routine passes this back to the application program. |
length$ |
Field width. |
message$ |
Message (prompt) to display at the bottom of the screen. |
helpfile$ |
Help information filename. |
helpitem$ |
Help item if using _help.pub format. |
title$ |
The title can be placed centered in a box by starting it with a "@"; include "\" or the specified newline_character$ to force a line break. |
col |
Column within the current window (-1 to center). |
row |
Row within the current window (-1 to center). |
control_value |
Control key value, according to the table under Key Maps. |
pad_character$ |
Pad character. See INPUTE in the Commands Manual. |
input_mask$ |
Input mask. Used for validation. |
output_mask$ |
Output mask. NOT used for validation. |
arguments$ |
Uses the same argument list as _ninput.utl and the following arguments: w Leave in the window created and return the window number in the WINDOW argument. t Do not translate the question. b Do not draw a box. * Just draw it, don't do input. |
|
The following attribute fields may be specified using any of the PRO/5 color and attribute mnemonics: |
input_attributes$ |
Input attributes (during data entry). |
output_attributes$ |
Output attributes (during display). |
no_shadow |
Set to 1 to suppress the box shadow. |
box_internal_color$ |
Box internal color (attribute string). |
box_border_color$ |
Box border color (attribute string). |
window_identifier |
Use this window; don't create one. |
scrolling_size |
Optional size of scrolling string. |
timeout |
Timeout (in integer seconds 1 to 255), or 0 for no timeout. |
newline_character$ |
Use this character to separate lines in the title. The default is "\" or the specified NEWLINE_CHAR$. |
column_character$ |
Use this character to separate columns in the title. |
Example
1000 LET BBEXT$=STBL("BBEXT")
1010 LET QUESTION$="Enter report Title:"
1020 CALL BBEXT$+"_ask.utl",QUESTION$,I$,25,$$,$$,$$,
1020:$$,10,12,CTLVAL
This creates the following prompt window: As an example of using a multiline title, use the following technique:
1010 LET BBEXT$=STBL("BBEXT")
1020 LET NEWLINE$=STBL("NEWLINE_CHAR")
1030 LET QUESTION$="Enter report Title :"
1040 LET TITLE$="@This is the first line of the title"+
1040:NEWLINE$+"This is the second line"+
1040:NEWLINE$+"This is the third line"
1050 CALL BBEXT$+"_ask.utl",QUESTION$,I$,25,$$,$$,$$,
1050:TITLE$,10,12,CTLVAL
The "@" symbol indicates that special windowing logic is to be used (by default, the lines will be centered) and must be the first character in the TITLE$. Otherwise, the title is embedded in the window border, and multiple lines are not allowed.