Save the text typed into a textbox before a function call

save_text

Save text that had been typed into a textbox before a function call


SYNTAX

save_text

When an EV_KEYSTROKE event or a function called by an on global or on local command sets focus to a new control, any new content that was typed into a textbox is by default not saved.

Using the save_text command inside the function causes the input to be validated and saved before the new control gains focus. Note that the text is not saved immediately, but when the function returns. It is only saved if it is valid. If the textbox has a validation function, this is called first.

The save_text command can also be used in a window’s EV_CLOSE event function. By default, when the user clicks on a window’s close button while a textbox has focus, any value typed into the box is not saved. save_text can be used in this situation to save the value, subject to validation.


EXAMPLE

     on global KEY_PGDN PageDown
     ...

!function PageDown() {
     save_text
     switch(sys.CurrentControl) {
          case ?= TextBox1:
               return TextBox2
               break

          case ?= TextBox2:
               return TextBox3
               break
     }
}

RELATED TOPICS

Textboxes

Textbox events and functions