EdCreate

EdCreate creates a new editor.

hEdit = EdCreate()
hEdit = EdCreate(ssFileName, ssLexer)

Return Value

If the function succeeds, the return value is the handle of the newly created editor.

Parameters

ssFileName

ssFileName is the complete filename, if the editor should be created from a existing file.

ssLexer

If ssLexer is specified syntax highlighting will be enabled. The following values are supported: “uniscript”, “lua”, “xml”, “text”, “po”.

Example

def Test()
{
    ShowWaitCursor(TRUE);
    hEdit = EdCreate();
    ssText = "This is just a test\r\n";
    ssText = ssText + "Date: " + date() + "\r\n";
    EdSetSel(hEdit, -1, -1);
    EdReplaceSel(hEdit, ssText);
    ssText = sprintf("%15s%15s%15s", "Value", "square root", "x*x")
    ssText = ssText + "\r\n";
    EdSetSel(hEdit, -1, -1);
    EdReplaceSel(hEdit, ssText);
    for (i in 1:100) {
        ssText = sprintf("%15.3lf%15.3lf%15f", i, sqrt(i), i*i);
        EdSetSel(hEdit, -1, -1);
        EdReplaceSel(hEdit, ssText + "\r\n");
    }
    EdSetSel(hEdit, -1, -1);
    EdReplaceSel(hEdit, "\r\n");
    EdSetSel(hEdit, -1, -1);
    ShowWaitCursor(FALSE);
}

History

Version Description
5.20.0 The bRTF (Rich Text Format) has been removed. New parameter ssLexer.
5.10.0 RTF (Rich Text Format) has been removed. UNICODE Text can be loaded.

id-24593