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

wd commands 11!:0

wd takes a string right argument and returns a string result. A wd argument is 0 or more statements delimited by semicolons. A statement is a command followed by 0 or more parameters. Commands and parameters are separated by one or more whitespace characters from the set: space, carriage return, line feed, tab, vertical tab, and form feed. Simple parameters start with an alphanumeric, -, or _, and run to a; or whitespace. A * starts a parameter at the next character, and runs to the end of the array. Delimited parameters start with ", 255{a. (EAV), or 197{a. and run to the matching delimiter. Some commands are not supported in some environments.

A wd error is a J domain error. Command qer returns the error message text and wd argument index for the last error.

The first letters of a command usually indicate a category: dde, mb (message box and common dialogs), menu, ole, p (parent), q (queries), set (setting properties), sm (session manager), and vbx.

A parameter can be an id, style, number, or text. An id identifies a parent, child, menu item, or other object. A style is a keyword, usually with a prefix. For example, bs_autoradiobutton is a button style.

A color is 3 parameters giving RGB values in the range 0 to 255. For example, 0 0 0 is black, 255 255 255 is white, and 255 0 0 is red.

A bool is 0 or 1 and is 1 if elided.

Several commands (clipcopy, smappend, smwrite, and set for edit and editm controls) have an optional parameter called trailing. If trailing is elided or 1, then trailing blanks are removed. If trailing is 0, then trailing blanks are not removed.

wd commands

acttask taskhandle ; activate task. winexec returns taskhandle.

acttitle title ; activate window with title bar that matches (case insensitive)

beep i ; beep i times

cc id class [style...] ; create child

clipcopy text [trailing] ; put text on the clipboard (line frets converted to host frets)

clipcopyx text ; put text on the clipboard (data unchanged)

clippaste ; result is text from the clipboard

cn name ; set child name after a cc command (otherwise setcaption is preferred)

creategroup id ; causes parent commands to be ignored so that, when a form definition is run, the child controls created are in the current form. The id is a control in the current form, usually a tab control, and child creates are offset from that control. Controls created under creategroup are hidden and are part of a group with the id from their ignored pc command. The setshow command with a group id hides or shows the controls in a group. A form definition loaded under creategroup is a normal form definition that can be designed and tested with the form editor. It is loaded by a main form with a form_run that is bracketed by creategroup commands. The first creategroup gives the id of a control in the main form and the final creategroup command has no parameter and ends the group.

creategroup ; ends the group started by a previous creategroup command

ddeadvise t i d ; send data to client in an advise loop. Client will get ddeadvise event.

ddecons ; return s|t active conversations

ddedis [s [t]] ; discontinue conversations

wd 'ddedis;'
conversations with all servers
wd 'ddedis s;'
conversations with server s
wd 'ddedis s t;'
conversation with server s on topic t
ddeex s t d ; data d is sent to server s for topic t to execute

ddename id ; set dde service name (can be done only once). Command line /ddename= can also set dde service name.

ddepoke s t i d ; send data to S|T!I

ddereq s t i ; data for item i is requested from S|T

ddereqd d ; send data in response to ddereq event (must be done immediately after ddereq event)

ddestart s t i ; advise loop requested for S|T!I. New data signals ddeadvise event.

ddestop s t i ; stop advise loop on S|T!I

fontdef fontspec; default font used when a child is created.

formsize button-width , button-height , edit-width, edit-height , label-height ; sets form edit default control sizes.

makejr in.ijs out.ijr ; converts ijs input file to a J runtime ijr file

mb title text [style...] ; messagebox with styles from set (mb_arbortretryignore, mb_defbutton2, mb_defbutton3, mb_iconasterisk, mb_iconexclamation, mb_iconhand, mb_iconinformation, mb_iconquestion, mb_iconstop, mb_ok, mb_okcancel, mb_retrycancel, mb_yesno, mb_yesnocancel)

mbcolor [colors] ; choose color common dialog box. Result is chosen color and 16 custom colors. Colors are 3 integers giving RGB values. Optional argument sets initial chosen color and 16 custom colors (51 integer values in range 0 to 255).

mbfont [fontspec] ; choose font common dialog. Start with last chosen and set new one if OK. Result is a fontspec.

mbopen title directory filename filterpairs [style...] ; open file common dialog returns fully qualified file name selected by user. Filterpairs are delimited by |. Styles are from the set (ofn_createprompt, ofn_filemustexist, ofn_nochangedir, ofn_overwriteprompt, ofn_pathmustexist).

wd 'qs mbopen'
wd 'mbopen'
wd 'mbopen  mytitle  ""  ""  "Write(*.wri)|*.wri|(Word(*.doc)|*.doc"
   ofn_filemustexist'

mbprinter [pd_printsetup] ; The parameter selects the setup dialog instead of the print dialog. The result is '' if the user pressed CANCEL. If the user pressed OK, the result is the name of the selected printer followed by LF delimited values. Currently the only value after the name is the print-to-file value from the print dialog. This sets the session default printer setup ithat is used by glzcreate with no argument.

mbsave title directory filename filterpairs [style...] ; save file common dialog returns fully qualified file name (see mbopen).

menu id text ; add menu item

menupop text; add popup menu item

menupopz ; ends popup menu and drops down a level

menusep ; separator line in a popup menu

oledlg id ; run property dialog. State can be saved with the olesave command.

oleenable id eventname [bool] ; enable/disable event. You must enable an event in order to trigger an event in J.

oleget id objectname property ; return property value. Objectname is base, temp, or a name set with oleid. If the result is an object, it is set as the temp object. This allows a series of wd commands that use the temp object to get the next object.

oleinfo id ; return information about events, methods, properties, and constants

oleload id filename ; initialize properties from a file created by olesave. An oleload should only be done once before it is shown.

olemethod id objectname method parameters....; run a method. , is an elided parameter. A wd parameter of , is the same as "", except it is treated as an elided parameter where appropriate.Some methods distinguish between a numeric parameter and a string. A simple (not delimited) string that is an integer is treated as an integer. If you want 23 to be treated as a string, use "23". If the result is an object, it is set as the temp object.

An object parameter is indicated by a simple parameter of the form: object:formid.childid.objectname

A picture object parameter is indicated by a simple parameter of the form: picture:filename

olesave id filename ; save properties in a file that can be used to initialize a control after it is created

oleset id objectname property value ; set property value

pctive ; SetActiveWindow for selected parent

pas i j ; parent size adjusted to provide i and j margins beyond children

pc id [style...] ; parent create. Styles are: nomenu, nomin, nomax, nosize, dialog, owner, and closeok.

pcenter ; center parent on screen

pclose ; close parent. If no parent selected, nothing is done and there is no error.

phandler sentence; sentence to run as form event handler instead of normal wdhandler'

pmove x y w h ; move and resize parent. Values are in logical units and are relative to the top left corner of the screen. Value of -1 inherits current value.

pmovex x y w h ; move and size form in pixels

pn text ; name for parent window caption

psel id ; select parent id to be target for subsequent commands

psel n ; select parent with qhwnp of n for subsequent command

psel ; clear parent and child selection

pshow [style] ; style is from the set: sw_hide, sw_minimize, sw_restore, sw_show, sw_showmaximized, sw_showminimized, sw_showminnoactive, sw_showna, sw_shownoactivate, sw_shownormal. sw_shownormal is the default.

pshowx n... ; argument is sysinfo data. Shows window as it was when sysinfo was set.

ptop [bool]; set 1 so that window stays on top of other windows

q ; return event data

qabout ; returns: release, minor release, system, edition, registration.
4.06
a
Windows 95
Professional Edition
0123-456-7890

Possible system strings: Macintosh, Windows NT, Windows 95, Windows 3.1.

qbreak ; returns count of menu/button/and toolbar commands that have been ignored because J was busy. This value can be polled in a loop with a long execution time to see if the user is getting impatient.

qchildxywh id; return child position and size in units

qchildxywhx id; return child position and size in pixels

qcmdline ; return command line

qcode data ; encodes data for use in order system.

qcolor color ; return RGB for system colors defined in system\packages\color\wdcolor.ijs

qd ; return data for form. Similar to q result.

qer ; return last error information

qformsize ; returns form edit default control sizes: button width, button height, edit width, edit height, label height.

qformx ; returns form x y w h values in pixels.

qhinst ; return HINSTANCE of application

qhwndc id; return HWND (handle) of child

qhwndp ; return HWND (handle) of current parent

qhwndx ; return HWND (handle) of application

qkeystate keys ; returns 0 or 1 (pressed) for each key in keys. The values in keys are virtual key values as defined in packages\graphics\vkeys.ijs.

qm ; return system metrics:
screen width, screen height,
x logical unit, y logical unit,
cxborder, cyborder,
cxfixedframe, cyfixedframe,
cxframe, cyframe,
cycaption, cymenu,
desktop x, desktop y,
desktop w, desktop h
More elements may be added.

qp ; return parent ids.

qprinters ; returns an LF delimited list of printers. The first entry is the session default printer. The second entry is the system default printer. The remaining entries are a list of all printers. The session default printer starts out as the system default printer and is changed by mbprinter or File|Print Setup.

qrt ; return 1 if runtime version

qrtf id; return RTF data from richedit control

qs [cmd] ; return styles or keywords used in command. cmd can be: cc, gpen, mb, mbopen, mbsave, pshow, sendkeys, smshow, or winexec

qscreen ; screen information (see glqprinter)
horzsize width in millimeters
vertsize height in millimeters
horzres width in pixels
Vertres height in raster lines (pixels)
logpixelsx horizontal pixels per logical inch
logpixelsy vertical pixels per logical inch
bitspixel number of color bits per pixel.
planes number of color planes
numcolors number of entries in the device's color table (_1 if > 8)
aspectx relative width of a pixel
aspecty relative height of a pixel
aspectxy diagonal width of a pixel

qsmact ; return file name of active window

qsmall ; return file names of all windows

qsmcsize ; return size in characters of jx output window

qsmmfmove ; size and position in pixels of J session (mainframe) window

qsmmfshow ; session show value (see qsmmfshow)

qsmout ; return file name of JX output window

qsmsize ; return size of smsel window (x y w h) in pixels

qsmwh ; return size of main frame client area in pixels

qvbx id ; return information about properties and events of VBX control

rem text ; remark

reset ; close all windows, release all wd resources and objects

sbar n; create status bar with n panes

sbarset id width text; set id, width, and text of the next statusbar pane. A width of -1 leaves the width unchanged. A set command sets the text of the pane.

sbarshow [bool]; show (1) or hide statusbar

sendkeys text ; send keystrokes to active window (Win31 only)
+^%~()[]{} are special characters
+ upshifts the next character (+a is the same as A)
^ control shift
% alt shift.
~ ENTER key.

To send a special character as a normal character enclose it in {}. To send + , put {+} in text.

{key n} repeats key n times. For example: {a 5} or {left 3}.

Keys without an ASCII value are indicated by keywords in braces. {tab} is the tabkey.

wd 'winexec calc.exe;'
wd 'acttitle calculator; sendkeys "123{+}4~";'

set id [parameters...] ; set object property

checkbox, radiobutton - check (1 or elided) or uncheck (0)

combobox - similar to listbox

edit, editm - set text. Takes optional trailing parameter.

isipicture - set filename of picture source. dib or bmp (device independent bitmap), wmf (windows metafile), or ico (icon) file to display.

listbox - clear contents and add items. A parameter can contain LF delimited items. Ownerdrawfixed listbox items are picture file names.

wd 'set  listbox  red  green  blue'
wd 'set  listbox  red  green  blue  "pink',LF,'orange"'

menu - check (1 or elided) or uncheck (0). If menu and toolbar button have same id, both are set.

progressbar - set value in range 0 to 100

richedit, richeditm - set RTF text

scrollbar - set min/position/max/pagesize values or just position

wd'set scrollbar 0 60 100 10'
wd'set scrollbar 75'

static - set text

statusbar - set pane text

tab - add a tab for each parameter

wd'set tab Jan Feb Mar Apr'

toolbar - check (1 or elided) or uncheck (0). If menu and toolbar button have same id, both are set.

trackbar - similar to scrollbar but has linesize in addition to pagesize

wd'set trackbar 0 60 100 10 2'

setbkgnd id color ; set background RGB color of richedit or richeditm control

setcaption id text ; set control caption. If control is ownerdraw button, text is picture filename.

setcolwidth id width ; set multicolumn listbox column width

setdelete id n ; delete tab item n

setenable id [bool] ; enable (1) or disable. Applies to menu items, toolbar buttons, and controls.

setfocus id ; set focus on control

setfont id fontspec; set font for control

setinsert id n text ; insert tab item at position n

setinvalid id ; InvalidateRect

setlimit id n ' limit length of user typed text in edit, editm, richedit, richeditm, combodrop, and combobox controls.

setreadonly id [bool] ; set readonly (1) for edit, editm, richedit, and richeditm

setreplace id newtext ; replace selected text with newtext in edit, editm, richedit, and richeditm control

setreplace id n newtext ; replace tab item n text with newtext

setscroll id n ; scroll n to be first visible line in editm and richeditm control

setselect id [parameters...] ; set selection

edit, editm, richedit, richeditm - parameters are [ start end [noscroll ] ]. Selects text from start to end. If start and end are elided, then all text is selected. If noscroll is elided or 1, then the selection is not scrolled into view. If noscroll is 0, then the selection is scrolled into view

combobox, listbox - -number of item to select. -1 clears selection.

trackbar - parameters are start and end of range to mark as selected

setshow id [bool] ; show (1) or hide. If it is a group id (the id of the pc command ignored by a creategroup), then all controls in the group are affected. Controls explicitly hidden are not affected by a group show.

settabstops id [ n [ n [ n...] ] ] ; sets tab stops in editm and listbox controls. Values are in dialog units.

setupdate id ; UpdateWindow

setxywh id x y w h ; set child position and size in units

setxywhx id x y w h ; set child position and size in pixels

smappend text [trailing] ; appends text to smsel window

smcascade ; menu Window/Cascade

smclose ; close smsel window (does NOT save)

smfocus ; set smsel window in focus

smfont fontspec; set font for all session manager windows

smformedit ; Edit|Form Edit for selected sm window

smgetsel ; return start and end caret selection information

smgetshow ; return sm mainframe window state: 0 normal, 1 maximized, 2 iconic

sminputlog ; return input log

smmfmove x y w h ; move and size J session in pixels. The qsmmfmove command returns the current information.

smmfshow [style] ; same style as for pshow. When J starts with a profile its starts with sw_hide and an smmfshow must be done to show the session. The qsmmfshow command returns the current information.

smove x y w y ; move and size smsel window (pixels)

smopen ; open (if not already open) file set by smsel

smprompt prompt [default [flag]] ; used in input line recall. The prompt is issued at the next request for input from the session manager. If default is supplied, it is added to the prompt and is highlighted. The flag is 0 if the normal J prompt should be deleted. The line recall facility uses smprompt.

smread ; return text from smsel window

smsave ; save selected window (if modified)

smsbarshow bool] ; show or hide status bar

smscroll i ; scroll selected window

smsel filename ; sets file name used to select window for other commands

smselact ; selects (smsel) the active window

smselout ; selects (smsel) the output window

smsetcmd n t name sentence help ;
n is 2 to 9 and indicates a function key
t is 0 for no definition, 1 for noisy, 2 for quiet, 3 for silent
name appears on Tool menu (include TAB to put Fn at right)
sentence is passed to J for execution when function key is pressed
help appears in status bar line at bottom of main window

smsetselect [start end [noscroll] ] ; Selects text from start to end. If start and end are elided, then all text is selected. If noscroll is elided or 1, then the selection is not scrolled into view. If noscroll is 0, then the selection is scrolled into view.

smshow [style] ; same style as for pshow

smtile ; menu Window/Tile

smtilea ; menu Window/Tile across

smwrite text [trailing] ; write new text to smsel

tbar filename; set filename of bmp file for toolbar

tbarset id index image; set id for a toolbar button. index is the position in the displayed toolbar and image is the index of the button bitmap to use from the toolbar bitmap.

tbarshow [bool]; show (1) or hide toolbar

timer i ; set interval timer to i milliseconds. Event systimer occurs when time has elapsed. The timer keeps triggering events until the timer is turned off. An argument of 0 turns the timer off. The systimer event may be delayed if J is busy, and it is possible for several delayed events to be reported as a single event.

vbxenable id eventname [parameter types] ; enable VBX control event

vbxevent eventname... ; VBX control

vbxget id property... ; get VBX control property

vbxrefresh id ; repaint VBX control

vbxset id property value... ; set VBX control property

wait ; the normal message loop executes a handler in immediate execution when an event occurs. This is overkill for getting input from a simple form, and the way mb works is simpler: the message box is displayed, other events are disabled until it is closed, and the result is the wd result. The wait command allows a form to be used in a similar way. The wait command shows the form, disables events except for that form, and waits for an event. The event information is given by

wd'q'
. While a wait form is active events in other forms, DDE events, and timer events are disabled. They are enabled when the wait form is closed.

winexec text [style]; Execute DOS or Windows program. style is same as for pshow.

wd ' winexec  "write.exe  text.wri"  sw_showmaximized;'

winhelp filename [context] ; run Windows help. Optional argument is integer topic number. Filename "" or " dictionary" (note leading blank) selects J Dictionary.

xywh x y w h ; sets rectangle. -1 value inherits the previous value.


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