Not all commands change the OK variable when they are executed. Only 208 commands in the language will set the OK variable when they execute.
As a reminder, if the command was executed correctly, the OK variable is set to 1, if not, then the OK variable is set to 0.
Here is the list of commands that set the OK variable:
ACCEPT
ADD RECORD
ADD SUBRECORD
APPEND DATA TO PASTEBOARD
Append document
APPLY TO SELECTION
ARRAY TO STRING LIST
Average
BACKUP
BLOB TO DOCUMENT
BLOB to list
BLOB TO PICTURE
BLOB TO USERS
BLOB TO VARIABLE
BUILD APPLICATION
CALL WEB SERVICE
CANCEL
Compact data file
COMPRESS BLOB
CONFIRM
CONVERT FROM TEXT
Convert to text
CREATE ALIAS
Create document
CREATE FOLDER
Create resource file
CREATE USER FORM
DELETE DOCUMENT
DELETE RESOURCE
DELETE USER FORM
DIALOG
DOCUMENT TO BLOB
DOM CLOSE XML
DOM Count XML attributes
DOM Count XML elements
DOM Create XML element
DOM Create XML Ref
DOM EXPORT TO FILE
DOM EXPORT TO VAR
DOM Find XML element
DOM Find XML element by ID
DOM Get first child XML element
DOM Get last child XML element
DOM Get next sibling XML element
DOM Get parent XML element
DOM Get previous sibling XML element
DOM Get Root XML element
DOM GET XML ATTRIBUTE BY INDEX
DOM GET XML ATTRIBUTE BY NAME
DOM Get XML element
DOM GET XML ELEMENT NAME
DOM GET XML ELEMENT VALUE
DOM Parse XML source
DOM Parse XML variable
DOM REMOVE XML ATTRIBUTE
DOM REMOVE XML ELEMENT
DOM SET XML ATTRIBUTE
DOM SET XML ELEMENT NAME
DOM SET XML ELEMENT VALUE
EDIT FORM
EDIT FORMULA
EXECUTE METHOD
EXECUTE ON CLIENT
EXPAND BLOB
EXPORT DATA
EXPORT DIF
EXPORT ODBC
EXPORT SYLK
EXPORT TEXT
Get 4D folder
Get current printer
GET DATA SOURCE LIST
GET HIGHLIGHTED RECORDS
GET ICON RESOURCE
Get indexed string
Get localized string
GET PASTEBOARD DATA
GET PICTURE FROM LIBRARY
GET PICTURE FROM PASTEBOARD
GET PICTURE METADATA
GET PICTURE RESOURCE
GET PRINT OPTION
GET REGISTERED CLIENTS
GET RESOURCE
Get resource properties
Get string resource
Get text from pasteboard
Get text resource
IMPORT DATA
IMPORT DIF
IMPORT ODBC
IMPORT SYLK
IMPORT TEXT
INTEGRATE LOG FILE
LAUNCH EXTERNAL PROCESS
LIST TO BLOB
LISTBOX DELETE ROW
LISTBOX INSERT ROW
LOAD SET
LOAD VARIABLES
Log File
Max
Min
MODIFY RECORD
MODIFY SUBRECORD
OBJECT DUPLICATE
OBJECT Get plain text
OBJECT Get styled text
OBJECT GET STYLED TEXT ATTRIBUTES
OBJECT SET PLAIN TEXT
OBJECT SET STYLED TEXT
OBJECT SET STYLED TEXT ATTRIBUTES
OLD RELATED ONE
OPEN 4D PREFERENCES
OPEN ADMINISTRATION WINDOW
Open document
Open resource file
ORDER BY
ORDER BY FORMULA
PAGE BREAK
PICTURE TO BLOB
PICTURE TO GIF
PRINT LABEL
PRINT SELECTION
PRINT SETTINGS
PRINTERS LIST
QR REPORT
QUERY
QUERY BY EXAMPLE
QUERY BY SQL
QUERY SELECTION
READ PICTURE FILE
RECEIVE PACKET
RECEIVE RECORD
RECEIVE VARIABLE
REGISTER CLIENT
RELATE ONE
Request
RESOLVE ALIAS
RESTORE
SAVE SET
SAVE VARIABLES
SAX ADD PROCESSING INSTRUCTION
SAX ADD XML CDATA
SAX ADD XML COMMENT
SAX ADD XML DOCTYPE
SAX ADD XML ELEMENT VALUE
SAX GET XML CDATA
SAX GET XML COMMENT
SAX GET XML DOCUMENT VALUES
SAX GET XML ELEMENT
SAX GET XML ELEMENT VALUE
SAX GET XML ENTITY
SAX Get XML node
Select document
Select folder
SELECT LOG FILE
Select RGB Color
SEND HTML FILE
SET CHANNEL
SET CURRENT PRINTER
SET DATABASE LOCALIZATION
SET DICTIONARY
SET FIELD RELATION
SET PICTURE METADATA
SET PICTURE RESOURCE
SET PICTURE TO PASTEBOARD
SET PRINT OPTION
SET RESOURCE
SET RESOURCE NAME
SET RESOURCE PROPERTIES
SET STRING RESOURCE
SET TEXT RESOURCE
SET TEXT TO PASTEBOARD
SET TIMEOUT
SHOW ON DISK
SQL CANCEL LOAD
SQL EXECUTE
SQL EXECUTE SCRIPT
SQL EXPORT DATABASE
SQL EXPORT SELECTION
SQL GET OPTION
SQL LOAD RECORD
SQL LOGIN
SQL LOGOUT
SQL SET OPTION
SQL SET PARAMETER
START SQL SERVER
START WEB SERVER
STRING LIST TO ARRAY
Sum
SVG Find element ID by coordinates
SVG SET ATTRIBUTE
SVG SHOW ELEMENT
TRUNCATE TABLE
UNREGISTER CLIENT
USE CHARACTER SET
USE EXTERNAL DATABASE
USE INTERNAL DATABASE
VALIDATE TRANSACTION
VARIABLE TO BLOB
VERIFY DATA FILE
VOLUME ATTRIBUTES
WRITE PICTURE FILE
XML GET ERROR
XSLT APPLY TRANSFORMATION
XSLT GET ERROR
XSLT SET PARAMETER
Note - this list does not include the plugin commands that set the OK variable.