BB___Command_String

=Command string= toc

Description
> Command strings are used to issue commands to windows or controls. > //To use:// > //Help|Sending Commands - two forms, with PRINT and without, link to Print | Use with GUI// > //Help|Understanding Syntax - inserting variables in command string, preserving spaces//

Syntax
> There two ways to send commands (and text) to windows or controls. Windows or controls are identified by their handle. > Old syntax, with PRINT (PRINT #handle, "command string") > The new syntax, allows us to drop the operator PRINT and the comma after handle (#handle "command string"): > Both ways work identically.
 * 1) print #txtWin, "The fox jumped over the dog."
 * 2) #txtWin "The fox jumped over the dog."

Hints
> Some command strings contain numbers, e.g. > code format="vbnet" print #win, "box 30 221" code > If we want to use variables instead of literal numbers, we should insert them so PRINT receives the same resulting string. That means preserving spaces: > code format="vbnet" x = 30 y = 221 print #main, "box ";x;" ";y code > (If spaces are not included, >> print "box";x;y > will result in Liberty BASIC seeing "box30221", which will not work. >> print "box ";x;" ";y > will result in right thing: "box 30 221" > ) > We can use the new form (without PRINT and comma). Internally it works the same way, so spaces should be preserved.

> Some controls accept text. In that case, the command string should begin with an exclamation mark (!). For example, in this case > code format="vbnet" #main.button1 "!disable" #main.button2 "disable" code > button1 would understand the command and became disabled, while button2 would receive the text and change its caption (text on a button) to "disabled".

Example
code format="vbnet" Place a simple, working example of the keyword here code

Useful Functions
code format="vbnet" Place a useful function using this keyword here code