GetInput (Print.sc)

GetInput(buffer maxLength [title font])

Displays an edit box so the player can enter text.

Parameters:
  • buffer (string) – A buffer in which to place the text that was entered.
  • maxLength (number) – The size of the text buffer.
  • title (string) – An optional title for the dialog.
  • font (number) – An optional font number.
Returns:

The length of the text that was input.

Example usage:

(method (SomeMethod &tmp [buffer 10])
        (= buffer NULL) // Set the first character to NULL to create an empty string
        (GetInput buffer 10 "Enter your name")
)

Important

The buffer is also used to initialize the edit field, so it should contain an empty string if you don’t want any text there to start with.