>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help User

# wd

This is defined as:

       wd=. 11!:0

wd is used monadically and takes an argument of a character string of one or more statements, separated by semicolons. These statements are converted by the Window Driver into the appropriate Windows function calls. The result is the result of executing the last statement. Each statement is a command followed by any required parameters.

Commands supported include:

- creation and use of Windows controls to allow user input
- instructions to the J session manager
- DDE and OLE links to other Windows software
- access to custom controls
- information queries

For details and a list of commands see the wd commands help file.

The result of wd is the information requested, typically as a character string, or empty if none. For example, the following queries the system metrics used by Windows (screen width, screen height, x logical units and y logical units:

       wd 'qm'
    640 480 8 16

This shows a 640 by 480 screen, with the base dialog font (used when creating forms) being 8 pixels wide and 16 pixels high.

The next example creates a dialog box that allows the user to select a font. The result is returned after the user closes the dialog box, and contains a string of items that describe the font selected:

       wd 'mbfont'
    "Lucida Console" 10 bold

An invalid command is signalled as a domain error:

       wd 'qz'
    |domain error
    |       wd'qz'

After an error, you can run command qer to query the error - the result is an error message, following by the index in the command where the error occured:

       wd 'qer'
    invalid command : 0

The following example executes Notepad, assuming it is available on your system - if not, try executing another program.

       wd 'winexec "\windows\notepad.exe"'
    0

The next example executes Notepad with the given filename argument (Notepad loads the file).

       wd 'winexec "\windows\notepad.exe system\main\dates.ijs"'
    0

In the case of an instruction, the result is empty. For example, the following sets the session manager to tile open windows (assuming there are two or more windows open), and returns an empty result:

       $ wd 'smtile'
    0 0

>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help User