.. highlightlang:: us .. index:: EdCreate .. _edcreate: EdCreate ======== .. us.tag EdCreate NOTREADYENGLISH Changed5100 Changed5200 :ref:`EdCreate` creates a new editor. .. function:: hEdit = EdCreate() hEdit = EdCreate(ssFileName, ssLexer) .. us.return **Return Value** If the function succeeds, the return value is the handle of the newly created editor. .. us.params **Parameters** .. uparam:: ssFileName *ssFileName* is the complete filename, if the editor should be created from a existing file. .. uparam:: ssLexer If *ssLexer* is specified syntax highlighting will be enabled. The following values are supported: "uniscript", "lua", "xml", "text", "po". .. us.example **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); } .. us.history **History** .. list-table:: :header-rows: 1 * - 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. .. seealso:: :ref:`overview-editors`, :ref:`EdDestroy`, :ref:`EdSetLexer` :sub:`id-24593`