A Red system object browser is available via the Menu Item: Object / Object Browser.
This tool uses Gregg Irwin’s Object Browser - Thanks Gregg for a great tool.
There is a Red command line integrated into Direct Code, as show below:
This allows you to type in any Red command. Depending on their context some values may not be visible by the Red commands that you run here. To re-run a command you have already entered just click on the 'RED>>' button. There is a handy "Mk Btn" (Make Button) button just to the right of the command line field. It will "Make a Button" and insert the button into the current layout where Red code will run when you click on it.
This is handy for testing, discoverying and experimenting with code that you need to understand.
The Red Code Snippet Testing Area can be opened by selecting the Menu Item: User / Run User Script.
I have found that this is the most efficient way for me to test and explore smaller segments of code without making changes to the program that I am building. Because the 'User Script' is run as an "Attached" program you can monitor, change and play with almost every part of the currently running program.
The User Script program can be modified in any way you wish by selecting the Menu Item: User / Edit User Script
You can turn on the the system/view/debug flag by selecting the Menu Item: Debug / System / System/View/Debug = ON or you can use the F11 key.
This allows you to see some of the internal workings of Red. Helpful to find out what keys are being pressed and what events are being generated.
You can get a listing of all of the named objects in your program by selecting the Menu Item: Object / Show Named Objects
Two debugging print functions are supplied by the Direct Code environment.
Both of these functions output can be turned on and off through the Menu Item: 'Debug/Logging/Logging OFF' or 'Debug/Logging/Logging ON' Or by pressing the F8 button.
-
lprint
which prints data to a log file called: direct-code.log. This log file will be saved in the folder that the program was run from. The log file is cleared every time the Red script is restarted. -
bprint
prints data to the screen as well as to the log file.
You can restart the 'Direct Code' program by selecting the Menu Item: File / Restart Direct Code (or presss the F12 key). Depending on the status of your program the original Red Console may show this error which you can ignore:
*** Script Error: path event/face/type is not valid for none! type *** Where: if *** Near : if event/face/type = 'window [switch event ] *** Stack: context view do-events do-actor do-safe error? run ask ask do-events do-safe