FutureBasic Logo

<<    Index    >> FutureBasic

input   statement / function



Syntax
[string =] input [%(x,y) [,] ] [prompt]

Requires
macOS 10.12+

Description
On execution, a small floating panel appears which accepts user input. Pressing the enter key returns a CFString containing the user's text in string. Pressing the 'esc' key aborts the statement by closing/canceling the panel and returning a NULL string.

The default location for the panel is 20 pixels in from the left and vertically centered on the app's front window. If there are no app windows, the panel is centered on the screen.

The prompt and (x,y) coordinate parameters are optional.

Parameters
Parameter Description
%(x,y) When this optional parameter is used, the input panel is positioned at point x,y relative to the top-left corner of the app's front window content area (or screen if the app does not have any open windows). If this parameter isn't specified, the input panel is displayed in its default location.
prompt A CFString-based message, supplied by the programmer's code, guides the user's input. It appears adjacent and immediately to the left of the input field.
 
Return value
A CFStringRef containing the user-entered text. If the input panel was dismissed with the 'esc' key, it returns NULL.  

See also
The CocoaUI header, Input.incl, for a list of auxiliary functions such as InputSetFormat.