Text Box L Directive

Syntax

%L%

Description

You can turn a standard text box control into a Xbasic Code Editor using the %L% formatting code. You should define column and row dimensions for the text box that are large enough to display a reasonable size code editor.

Code = ""
Result = ui_dlg_box("Script",<<%dlg%
{region}
Type in some Xbasic code, then click OK to execute the code.;
{line=1,0};
[%L%.80,15code]
{endregion};
{region}
<*15&OK> <15&Cancel>;
{endregion}
%dlg%)
if result = "&OK" then
    evaluate_template(code)
end if  

This script produces this dialog:

images/XD_Code_Editor_Control.gif

See Also