Make text box active in a user dialog in Grapher via automation

The Scripter language provides several predefined functions for prompting the script user for information. This article provides the commands needed to create a user dialog text box and make it active from a Grapher script. This is useful when the user wants to provide user-specific text information to be used in the script (e.g. the name of a plot or the location of a data file) without having to edit the script itself. 
 

A "Begin Dialog UserDialog" statement must be added to the main sub routine in order to make the user dialog text box appear when the script is executed. In the example below, "550, 112" indicate where the dialog will appear on the user's screen, "Enter Run Date" is the name of the dialog, and ".DialogFucn" is the reference to the dialog function:  

        Begin Dialog UserDialog 550,112,"Enter Run Date",.DialogFunc

 

After the End Sub line, add this dialog function:

       Function DialogFunc%(DlgItem$, Action%, SuppValue%)
              DlgFocus "Text1"
       End Function

 

See the attached user dialog example -- text box focus for an example script that uses this dialog text box function. 

For more information, please see UserDialog Example in the in-program Help. For information about the Begin Dialog Statement and the dialog function, please see Begin Dialog Statement in the in-program BASIC Language Help (Click Automation | BASIC Language Help). 
 

 

 

Updated August 2019

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.