K function reference
A findStringFiles launchProcess redo
aboutDialog findStringGrep launchProcessToMessages redoAvailable
addMenu focusCommandBar leftString repeatFind
addMenuItem G length replaceString
addMenuSeparator getBlockEnd lineDown replaceStringFiles
addToolButton getBlockStart lineUp resetMark
addToolSpace getChar loadDialog replaceDialog
atLineEnd getCurrentControlId loadFile resetViewWin
B getCursorColumn loadModule rGetChar
beginMainMenu getEncoding M rGetText
beginMark getFileId macroSaveDialog rightString
beginPopupMenu getFilename markAll S
beginSubmenuUpdate getLine markCharLeft saveDialog
bindKey getKonDir markCharRight saveFile
blockMarked getLineStart markNextWord saveFileAs
browse getLineEnd markLine saveMacro
C getMarkBeginColumn markLineDown saveNumberedPos
charLeft getMarkEndColumn markLineUp savePos
charRight getPosition markPageDown searchDialog
charToString getScratchName markPageUp setBlockEnd
checkMenuItem getScreenUpdate markPrevWord setBlockStart
clearAll getRecentFile markToDocumentEnd setCursorColumn
clearSavedPositions getRecentFilesCount markToDocumentStart setDelimitorLines
closeActiveWindow getSetting markToLineEnd setScreenUpdate
closeControl getSyntaxCount markToLineStart setSyntax
closeFrameWindow getSyntaxName markWord setToolActive
convertBufferFromUnicode getSyntaxNameAtPos messageBox setView
copyBlockToClipboard getText messageWindowDisplay snapshot
copyMacroToClipboard getTextLength messageWindowVisible startMacroRecord
copyTextToClipboard getTime midString startUndoBlock
createFrameWindow getWindowCount N stringToChar
cutBlockToClipboard getWindowFilename nextTab switchField
D getWindowId nextView switchExecutingControl
debug H nextWord switchToControl
deleteBlock hasSavedPositions O switchToFile
deleteCharacter hasValidBlockMark outdentBlock T
deleteLine I P tabPressed
deletePreviousCharacter indent pageDown textModified
deleteText indentBlock pageUp toDocumentEnd
deleteToEOL insertLine pasteBlockFromClipboard toDocumentStart
deleteWord insertString popupMenu toggleColumnBlock
E integrityCheck popPos toggleRelativePos
enableMenuItem isInteger popupWindow toInt
endMacroRecord isRecording prefsDialog toLineEnd
endMainMenu isString prevTab toLineStart
endMark J prevWord toString
endPopupMenu jumpToLine print U
endSubmenuUpdate jumpToLineDialog printDialog undo
endUndoBlock jumpToNextPos printFile undoAvailable
executeKFromClipboard jumpToNumberedSavedPos pushPos unloadModule
F jumpToPosDialog Q updateMainMenu
fileExists jumpToPosition queryLineDialog updateSetting
fileLoadDialog jumpToPrevPos queryView W
fileSaveDialog K R window
fillColumnBlock keepBlock readRelease
findString L readRequest

aboutDialog
Description:
Display About dialog
Parameters
none
Return value:
Nothing

addMenu
Description:
Add a sub menu to a menu.
Parameters
atId The menu id where the sub-menu should be placed under
string Menu title
menuId Id of menu
Return value:
Nothing

addMenuItem
Description:
Add a menu item to a menu
Parameters
atId The id of them menu where the menu item should be placed.
string Menu title
command A valid K-statement to execute when this menu item is selected.
menuId Id of menu item
Return value:
Nothing

addMenuSeparator
Description:
Add a menu separator to a menu.
Parameters
atId The id of them menu where the separator should be placed.
Return value:
Nothing

addToolButton
Description:
Adds a tool to the toolbar
Parameters
command A valid K-statement
bitmap Full path to the bitmap which should be used as the toolbar icon.
description Tool description
id Tool ID
Return value:
Nothing

addToolSpace
Description:
Adds a space delimitor to the toolbar
Parameters
none
Return value:
Nothing

atLineEnd
Description:
Checks if there is a line end at the specified position.
Parameters
reader Read handler
pos Position to check
Return value:
TRUE if there is a line end at the position

beginMainMenu
Description:
Start building then main menu. Menu build must be ended with an endMainMenu. See menu.k for an example of how to build the main menu.
Parameters
none
Return value:
Nothing

beginMark
Description:
Start marking text.
Parameters
none
Return value:
Nothing

beginPopupMenu
Description:
Start building a popup menu. See menu.k for an example of how to use this function.
Parameters
none
Return value:
Nothing

beginSubmenuUpdate
Description:
Start building or adding to a drop-down menu in main menu. See menu.k for an example of how to use this function
Parameters
id Menu id for the sub menu
removeItems Menu id for the sub menu
Return value:
Nothing

bindKey
Description:
Binds a key sequence to a K-command
Parameters
keySeq Describes the key sequence.

Form a key sequence as:
Modifer1+Key1-Modifer2+Key2...ModiferN+KeyN

Example: Ctrl+q-Ctrl+f

Recognized key constants:
Ctrl, Alt, Shift, Left, Right, Up, Down, PageUp, PageDown, Home, End, Insert, Delete, Escape, Enter, Backspace, Return, Tab, Space, F1-F12, any alphanumeric character.
command Any valid K-statement
Return value:
Nothing

blockMarked
Description:
Callback function. Called when the active textbuffer has a block marked.
Parameters
isMarked TRUE if block is marked
Return value:
Nothing

browse
Description:
Starts the web browser with an URL.
Parameters
URL The URL
Return value:
Nothing

charLeft
Description:
Move one character left
Parameters
none
Return value:
TRUE if successful

charRight
Description:
Move one character right
Parameters
none
Return value:
TRUE if successful

charToString
Description:
Converts a character code to a string. Returns the string.
Parameters
data Integer representing a character code
Return value:
String

checkMenuItem
Description:
Set or remove a check mark next to a menu item.
Parameters
id Menu id where the mark should set or reset
checked TRUE to set, FALSE to remove
Return value:
Nothing

clearAll
Description:
Removes all text from the whole document.
Parameters
none
Return value:
Nothing

clearSavedPositions
Description:
Removes all saved positions.
Parameters
none
Return value:
Nothing

closeActiveWindow
Description:
Close the active control (window).
Parameters
none
Return value:
Nothing

closeControl
Description:
Close a control (window).
Parameters
id Id of control to be closed
Return value:
Nothing

closeFrameWindow
Description:
Close the main window. Will close all controls within it.
Parameters
none
Return value:
Nothing

convertBufferFromUnicode
Description:
Converts the text in the current buffer from Unicode to Ansi representation. This conversion cannot be undone!
Parameters
encoding 1 (UTF8), 2 (UTF16)
Return value:
Nothing

copyBlockToClipboard
Description:
Copy selected text to the clipboard
Parameters
none
Return value:
Nothing

copyMacroToClipboard
Description:
Copy the currently recorded macro to the clipboard
Parameters
none
Return value:
Nothing

copyTextToClipboard
Description:
Copy text to clipboard
Parameters
text Text to copy
Return value:
Nothing

createFrameWindow
Description:
Create a new main window
Parameters
none
Return value:
Nothing

cutBlockToClipboard
Description:
Cut selected text to the clipboard
Parameters
none
Return value:
Nothing

debug
Description:
Debug memory. Internal use only
Parameters
none
Return value:
Nothing

deleteBlock
Description:
Delete the selected block.
Parameters
none
Return value:
Nothing

deleteCharacter
Description:
Delete the current character
Parameters
none
Return value:
Nothing

deleteLine
Description:
Deletes the line at cursor.
Parameters
none
Return value:
Nothing

deletePreviousCharacter
Description:
Delete the previous character from cursor position.
Parameters
none
Return value:
Nothing

deleteText
Description:
Delete text
Parameters
position Start position
size Length of text to delete
Return value:
Nothing

deleteToEOL
Description:
Deletes to end of line.
Parameters
none
Return value:
Nothing

deleteWord
Description:
Deletes the current word.
Parameters
none
Return value:
Nothing

enableMenuItem
Description:
Enable or disable a menu item
Parameters
id Menu id which should be enabled/disabled
enabled TRUE to enable, FALSE to disable
Return value:
Nothing

endMacroRecord
Description:
End recording the macro.
Parameters
none
Return value:
Nothing

endMainMenu
Description:
End building the main menu
Parameters
none
Return value:
Nothing

endMark
Description:
End marking text.
Parameters
none
Return value:
Nothing

endPopupMenu
Description:
End building a popup menu
Parameters
none
Return value:
Nothing

endSubmenuUpdate
Description:
End updating a submenu
Parameters
none
Return value:
Nothing

endUndoBlock
Description:
Ends the current undo block.
Parameters
none
Return value:
Nothing

executeKFromClipboard
Description:
Execute K-code residing in the clipboard
Parameters
none
Return value:
Nothing

fileExists
Description:
Check if a file exists in the file system
Parameters
filename Filename to test
Return value:
TRUE if the specified filename exists

fileLoadDialog
Description:
Brings up a file dialog and loads the selected file.
Parameters
none
Return value:
Nothing

fileSaveDialog
Description:
Brings up a file dialog and saves the selected file.
Parameters
none
Return value:
Nothing

fillColumnBlock
Description:
Fills a selected column block with a string.
Parameters
none
Return value:
Nothing

findString
Description:
Find a string in the text
Parameters
string String to search for
options Options string:

'd': Global search. (Not set: Selected text)
'b': Backward search. (Not set: Forward search)
's': Search selected text. (Not set: Search whole file)
'u': Case insensitive search.
'w': Find whole words only.
'g': Use regular expressions.
Return value:
TRUE if string was found

findStringFiles
Description:
Find a string in multiple files and display the results in the message window.
Parameters
searchString String to search for
options Options string:

'd': Global search. (Not set: Selected text)
'b': Backward search. (Not set: Forward search)
's': Search selected text. (Not set: Search whole file)
'u': Case insensitive search.
'w': Find whole words only.
'g': Use regular expressions.
'r': Search sub directories.
path Path where to start searching
files Files to search, separated by ';'. Wildcards allowed.
Return value:
Nothing

findStringGrep
Description:
A specialized function for finding string using regular expressions. The difference between this function and 'findString' is that this will also return an array consisting of the substrings specified using the grouping function in the regular expression.
Parameters
string String to search for
options Options string:

'd': Global search. (Not set: Selected text)
'b': Backward search. (Not set: Forward search)
's': Search selected text. (Not set: Search whole file)
'u': Case insensitive search.
'w': Find whole words only.
substrings An array of found substrings.
Return value:
TRUE if string was found

focusCommandBar
Description:
Focus the command bar int eh active main window.
Parameters
none
Return value:
Nothing

getBlockEnd
Description:
Returns the marked block end.
Parameters
none
Return value:
Block end

getBlockStart
Description:
Returns the marked block start.
Parameters
none
Return value:
Block start

getChar
Description:
Return a character
Parameters
position Position in the text
Return value:
Character code

getCurrentControlId
Description:
Returns the ID for the currently executing control.
Parameters
none
Return value:
Column

getCursorColumn
Description:
Returns the current column for the cursor.
Parameters
none
Return value:
Column

getEncoding
Description:
Returns the encoding for the active buffer.
Parameters
none
Return value:
0 (ANSI), 1 (UTF8), 2 (UTF16)

getFileId
Description:
Returns the id for a buffer with a named file
Parameters
filename Position in the text
Return value:
Id of control

getFilename
Description:
Returns the filename for the current file
Parameters
none
Return value:
Filename

getLine
Description:
Returns the current line in the text.
Parameters
none
Return value:
Current line

getKonDir
Description:
Returns the Directory where the Kon program file resides.
Parameters
none
Return value:
Full path where the exe file resides (excluding the exe file itself)

getLineStart
Description:
Returns the line start for the current line.
Parameters
none
Return value:
Character position for linestart

getLineEnd
Description:
Returns the line end for the current line.
Note that there must be no writers on the buffer when calling this function or the call will block.
Parameters
none
Return value:
Character position for linestart

getMarkBeginColumn
Description:
Returns the column where the marked block starts. Only valid in ASCII-view.
Parameters
none
Return value:
A column

getMarkEndColumn
Description:
Returns the column where the marked block ends. Only valid in ASCII-view.
Parameters
none
Return value:
A column

getPosition
Description:
Returns the cursor position in the text.
Parameters
none
Return value:
Character position

getScratchName
Description:
Returns the a scratch buffer name. No buffer is opened, this has to be done using loadFile.
Parameters
none
Return value:
filename

getScreenUpdate
Description:
Returns the marked block end.
Parameters
none
Return value:
Block end

getRecentFile
Description:
Returns the recently opened file at a certain position in the list.
Parameters
pos Position in the list
Return value:
Filename

getRecentFilesCount
Description:
Returns the number of files in the recently opened files list
Parameters
none
Return value:
Number of files

getSetting
Description:
Query setting
Parameters
setting One of the following strings:

'autosave': TRUE if auto save should be done.
'backupfiles': TRUE if .BAK file should be created on file save.
'columnblock': Columnblock marking (TRUE/FALSE).
'crlf': TRUE if CR+LF line end sequence should be used, FALSE if LF only.
'hexcursorbg': Colorvalue(RGB) of hex cursor background.
'hexcursorfg': Colorvalue(RGB) of hex cursor.
'hilitebg': Colorvalue(RGB) of highlight background.
'hilitefg': Colorvalue(RGB) of highligt foreground.
'insertmode': TRUE if insert mode, FALSE if overwrite mode.
'leftMarginbg': Colorvalue(RGB) of left margin background.
'leftMarginfg': Colorvalue(RGB) of left margin.
'markerbg': Colorvalue(RGB) of marked position background.
'markerfg': Colorvalue(RGB) of marked position.
'markbg': Colorvalue(RGB) of mark background.
'markfg': Colorvalue(RGB) of mark foreground.
'maxUndoSize': Max number of undo steps.
'optimalfill': TRUE to fill long space runs whith tab character (0x9) when possible..
'persistentblocks': TRUE if persistent blocks should be used.
'reuseExistingBuffer : TRUE if an existing buffer and control should be used instead of reloading when a file is opened.
'rightmargin': The right margin.
'showLeftMarginInfo' : TRUE to show the left margin info.
'showLineNumber' : TRUE to show line numbers in the left margin.
'showSavedPos' : TRUE to show saved position in the left margin. 'standarddelim': Standard delimitor string. (When no syntax highlighting is defined.)
'showrightmargin': TRUE if the right margin should be shown in the text window.
'stripnameinnotebook': TRUE if only filename without path should be displayed in notebook tabs.
'syntaxhighlight': TRUE if syntax highlightinh should be used.
'tabsize': Set the tab size.
'usetab': TRUE to insert real tab character (0x9), FALSE to insert spaces.
Return value:
Returns the setting

getSyntaxCount
Description:
Returns the Number of syntax schemes available
Parameters
none
Return value:
Nothing

getSyntaxName
Description:
Returns the name of the current syntax highlighting scheme
Parameters
none
Return value:
Name of scheme

getSyntaxNameAtPos
Description:
Returns the name of the syntax scheme at a position
Parameters
pos Position of syntax scheme (0 min, getSyntaxCount - 1 max
Return value:
Nothing

getText
Description:
Get text
Parameters
position Position where to retrieve text
size Length of text
Return value:
Text string

getTextLength
Description:
Returns the length of the file
Parameters
none
Return value:
Current file length

getTime
Description:
Returns the current time.
Parameters
formatstring Format string:

%a %A: Abbreviated weekday name
%b: Full weekday name
%B: Abbreviated month name
%c: Full month name
%d: Date and time representation appropriate for locale
%H: Day of month as decimal number (01 - 31)
%I: Hour in 24-hour format (00 - 23)
%j: Hour in 12-hour format (01 - 12)
%m: Day of year as decimal number (001 - 366)
%M: Month as decimal number (01 - 12)
%p: Minute as decimal number (00 - 59)
%S: Current locale’s A.M./P.M. indicator for 12-hour clock
%U: Second as decimal number (00 - 59)
%w: Week of year as decimal number, with Sunday as first day of week (00 - 53)
%W: Weekday as decimal number (0 – 6; Sunday is 0)
%x: Week of year as decimal number, with Monday as first day of week (00 - 53)
%X: Date representation for current locale
%y: Time representation for current locale
%Y: Year without century, as decimal number (00 - 99)
%z, %Z: Year with century, as decimal number
%%: Time-zone name or abbreviation; no characters if time zone is unknown
%%: Percent sign
Return value:
Formatted time string

getWindowCount
Description:
Returns the number of opened windows (Controls)
Parameters
none
Return value:
Number of controls

getWindowFilename
Description:
Returns the filename for the specified position in the window list
Parameters
pos Position in the list
Return value:
Filename

getWindowId
Description:
Returns the ID for a specific window
Parameters
pos Position in the window list
Return value:
Window ID

hasSavedPositions
Description:
Check if there exists saved positions.
Parameters
none
Return value:
TRUE if at least one positions is saved

hasValidBlockMark
Description:
Check if a block is marked.
Parameters
none
Return value:
TRUE if a block is marked

indent
Description:
Indent a line
Parameters
position Position in text
fromColumn Column from where text should be indented
toColumn Column where text should be indented to
Return value:
Nothing

indentBlock
Description:
Indents a selected block.
Parameters
steps Spaces to indent
Return value:
Nothing

insertLine
Description:
Inserts a line break.
Parameters
none
Return value:
Nothing

insertString
Description:
Insert a text string in the text.
Parameters
string String to insert
Return value:
Nothing

integrityCheck
Description:
Debug. Internal use only
Parameters
none
Return value:
Nothing

isInteger
Description:
Check if the supplied value is an integer
Parameters
arg Value to test
Return value:
TRUE if the supplied value is an integer

isRecording
Description:
Check if a macro is recording.
Parameters
none
Return value:
TRUE if a macro is recording.

isString
Description:
Check if the supplied value is a string
Parameters
arg Value to test
Return value:
TRUE if the supplied value is a string

jumpToLine
Description:
Jump to a line in the text
Parameters
line Line to jump to
Return value:
Nothing

jumpToLineDialog
Description:
Jumps to the line specified in the dialog.
Parameters
none
Return value:
Nothing

jumpToNextPos
Description:
Jump to next saved position
Parameters
none
Return value:
Nothing

jumpToNumberedSavedPos
Description:
Restores the current position from a slot.
Parameters
markNum Slot 0-9
Return value:
Nothing

jumpToPosDialog
Description:
Jumps to the position specified in the dialog.
Parameters
none
Return value:
Nothing

jumpToPosition
Description:
Jump to an absolute character position in the text
Parameters
position Character position
Return value:
Nothing

jumpToPrevPos
Description:
Jump to previous saved position
Parameters
none
Return value:
Nothing

keepBlock
Description:
Sets if blocks should be temporary persistent.
Parameters
keep TRUE for temporary persistent blocks
Return value:
Nothing

launchProcess
Description:
Launches a process and optionally captures the output and sends it to a control
Parameters
exefile EXE file name including parameters.
arguments Program arguments which may include:
%f: Name of current file
capture TRUE to capture output
controlId If capture, id of control to send output to
Return value:
String

launchProcessToMessages
Description:
Launches a process, captures the output to the messages window and optionally supplies a regular expression which is used for separating out filename, line and column info when a line is double clicked.
Parameters
exefile EXE file name including parameters.
arguments Program arguments which may include:
%f: Name of current file
positionRegExp A regular expression describing the layout of the line, column and filename for a clickable row in the output. For identifying the different fields, group expressions. Example:

The layout of a message row is

FILENAME (LINE, COLUMN) : Message

The regular expression would be:

(.)+ \\((:n)+, (:n)+\\) \:
fileAndPosGroup A list of which groups should be used for file and position information. The list is defined as [# filename group, # line group, # column group]
For the example above the list would be:

[0,1,2]
Return value:
Nothing

leftString
Description:
Returns the left portion of a string
Parameters
string String to copy from
characters Characters to copy
Return value:
String

length
Description:
Returns the length of an array or string
Parameters
array Array or string
Return value:
Length of string

lineDown
Description:
Move one line down
Parameters
none
Return value:
TRUE if successful

lineUp
Description:
Move one line up
Parameters
none
Return value:
TRUE if successful

loadDialog
Description:
Display the file requester.
Parameters
title Title of dialog, e.g. "Open", "Save."
filename Initial file name
Return value:
If a filename is selected, the filename is returned, otherwise an empty string is returned

loadFile
Description:
Start loading a file
Parameters
filename Filename of file to load
backgroundLoad TRUE if the file should be loaded asynchronously
useExisting TRUE if we should focus an already exisisting control if the file is already loaded
Return value:
ID of the opened buffer

loadModule
Description:
Load a K-module
Parameters
filename Filename of K-file to load
preload 0 = Do not preload this module, 1 = preload, 2 = reserved value
Return value:
TRUE if successfull

macroSaveDialog
Description:
Brings up a file dialog and saves the currently recorded macro. The macro is saved as a K function.
Parameters
none
Return value:
Nothing

markAll
Description:
Marks all text in the whole document.
Parameters
none
Return value:
Nothing

markCharLeft
Description:
Marks one char left.
Parameters
none
Return value:
Nothing

markCharRight
Description:
Marks one char right.
Parameters
none
Return value:
Nothing

markNextWord
Description:
Marks the next word.
Parameters
none
Return value:
Nothing

markLine
Description:
Marks the current line.
Parameters
none
Return value:
Nothing

markLineDown
Description:
Marks one line down.
Parameters
none
Return value:
Nothing

markLineUp
Description:
Marks one line up.
Parameters
none
Return value:
Nothing

markPageDown
Description:
Marks one page down.
Parameters
none
Return value:
Nothing

markPageUp
Description:
Marks one page up.
Parameters
none
Return value:
Nothing

markPrevWord
Description:
Marks the previous word.
Parameters
none
Return value:
Nothing

markToDocumentEnd
Description:
Marks to document end.
Parameters
none
Return value:
Nothing

markToDocumentStart
Description:
Marks to document start.
Parameters
none
Return value:
Nothing

markToLineEnd
Description:
Marks to line end.
Parameters
none
Return value:
Nothing

markToLineStart
Description:
Marks to line start.
Parameters
none
Return value:
Nothing

markWord
Description:
Marks the current word.
Parameters
none
Return value:
Nothing

messageBox
Description:
Display a message box.
Parameters
title Title of message box
message Message
type MBERROR (1), MBWARNING (2), MBMESSAGE (3), MBQUERY (4)
Return value:
MBRESOK (5)
MBRESCANCEL (6)
MBRESYES (7)
MBRESNO (8)

messageWindowDisplay
Description:
Displays or hides message window
Parameters
show TRUE to show
Return value:
Nothing

messageWindowVisible
Description:
Check if the message window is visible.
Parameters
none
Return value:
Returns TRUE if the message window is visible

midString
Description:
Returns a portion of a string
Parameters
string String to copy from
start Starting position
characters Characters to copy
Return value:
String

nextTab
Description:
Move to next control in the opened files notebook
Parameters
none
Return value:
Nothing

nextView
Description:
Switch to the next view. (currently ASCIIVIEW (0) or HEXVIEW (1)).
Parameters
none
Return value:
Nothing

nextWord
Description:
Moves to the next word.
Parameters
none
Return value:
Nothing

outdentBlock
Description:
Outdents a selected block.
Parameters
steps Spaces to outdent
Return value:
Nothing

pageDown
Description:
Move one page down
Parameters
none
Return value:
TRUE if successful

pageUp
Description:
Move one page up
Parameters
none
Return value:
TRUE if successful

pasteBlockFromClipboard
Description:
Paste text from clipboard at the current position
Parameters
none
Return value:
TRUE if data was available

popupMenu
Description:
Display a popup menu
Parameters
windowObject Passed from callback function buildPopupMenu
x Passed from callback function buildPopupMenu
y Passed from callback function buildPopupMenu
Return value:
Nothing

popPos
Description:
Pop a position from the position stack.
Parameters
none
Return value:
TRUE if successful

popupWindow
Description:
Popups a popup window with a text. Is automatically removed when the cursor is moved a certain distance.
Parameters
text Text to display
Return value:
Nothing

prefsDialog
Description:
Display the preferences dialog
Parameters
none
Return value:
Nothing

prevTab
Description:
Move to previous control in the opened files notebook
Parameters
none
Return value:
Nothing

prevWord
Description:
Moves to the previous word.
Parameters
none
Return value:
Nothing

print
Description:
Prints a text string to the message window
Parameters
data String or value to display
Return value:
Nothing

printDialog
Description:
Displays the print dialog
Parameters
none
Return value:
Nothing

printFile
Description:
Prints the current file.
Parameters
none
Return value:
Nothing

pushPos
Description:
Push the current position onto the position stack.
Parameters
visible TRUE to show this mark in the left margin
Return value:
TRUE if successful

queryLineDialog
Description:
Display a dialog with an entry field.
Parameters
title Title of the dialog
query Text of dialog
data (By reference) Initial data and returned data
Return value:
Returns TRUE if the dialog was confirmed.

queryView
Description:
Display a dialog with an entry field.
Parameters
none
Return value:
ASCIIVIEW (0) or HEXVIEW (1)

readRelease
Description:
Close the current read handle.
Parameters
none
Return value:
Nothing

readRequest
Description:
Returns a handle for read requests. Must be closed using readRelease after use!
Parameters
none
Return value:
Reader handle

redo
Description:
Redo one step
Parameters
none
Return value:
TRUE if successful

redoAvailable
Description:
Callback function. Called when the active textbuffer has redo available.
Parameters
hasRedo TRUE if redo is available
Return value:
Nothing

repeatFind
Description:
Repat last search or replace operation.
Parameters
none
Return value:
TRUE if string was found

replaceString
Description:
Replace a string
Parameters
searchString String to search for
replaceString String to replace with
options Options string:

'd': Global search. (Not set: Selected text)
'b': Backward search. (Not set: Forward search)
's': Search selected text. (Not set: Search whole file)
'u': Case insensitive search.
'w': Find whole words only.
'g': Use regular expressions.
'n': Prompt before replace.
'a': Replace all occurences. (Not set: Replace only the first found.)
Return value:
TRUE if string was found

replaceStringFiles
Description:
Replace strings in multiple files
Parameters
searchString String to search for
replaceString String to replace with
options Options string:

'd': Global search. (Not set: Selected text)
'b': Backward search. (Not set: Forward search)
's': Search selected text. (Not set: Search whole file)
'u': Case insensitive search.
'w': Find whole words only.
'g': Use regular expressions.
'n': Prompt before replace.
'a': Replace all occurences. (Not set: Replace only the first found.)
'r': Search sub directories.
path Path where to start searching
files Files to search, separated by ';'. Wildcards allowed.
Return value:
Nothing

resetMark
Description:
Reset block markers.
Parameters
none
Return value:
Nothing

replaceDialog
Description:
Display the search and replace dialog. The dialog will issue the replace command.
Parameters
none
Return value:
Nothing

resetViewWin
Description:
Used to reflect changes in configuration on screen
Parameters
keepWindowStart TRUE if window start should not be reset
Return value:
Nothing

rGetChar
Description:
Return a character using a reader handle
Parameters
reader Reader handle
position Position in the text
Return value:
Character code

rGetText
Description:
Get text using reader handle
Parameters
reader Reader handle
position Position where to retrieve text
size Length of text
Return value:
Text string

rightString
Description:
Returns the right portion of a string
Parameters
string String to copy from
characters Characters to copy
Return value:
String

saveDialog
Description:
Display the file requester.
Parameters
title Title of dialog, e.g. "Open", "Save."
filename Initial file name
encoding 0 (ANSI), 1 (UTF8), 2 (UTF16). Will also return the choosen encoding.
Return value:
If a filename is selected, the filename is returned, otherwise an empty string is returned

saveFile
Description:
Save the current file
Parameters
none
Return value:
Nothing

saveFileAs
Description:
Save the current file to a different file name.
Parameters
filename New filename
encoding 0 (ANSI), 1 (UTF8), 2 (UTF16)
Return value:
Nothing

saveMacro
Description:
Save the currently recorded macro
Parameters
filename Filename to save to
Return value:
Nothing

saveNumberedPos
Description:
Saves the current position in a slot.
Parameters
markNum Slot 0-9
Return value:
Nothing

savePos
Description:
Saves the current position
Parameters
none
Return value:
Nothing

searchDialog
Description:
Display the search dialog. The dialog will issue the search command.
Parameters
none
Return value:
Nothing

setBlockEnd
Description:
Sets the block end
Parameters
position Position of block end
Return value:
Nothing

setBlockStart
Description:
Sets the block start
Parameters
position Position of block start
Return value:
Nothing

setCursorColumn
Description:
Jump to column
Parameters
column Column to jump to
Return value:
Nothing

setDelimitorLines
Description:
Sets a list of delimitor lines which are displayed in the Ascii view. These are ideal when viewing files with entries in a fixed field length layout.
Parameters
lines Array of columns where delimitor lines should be placed Ex. {10, 30, 45, 60}.
Return value:
Nothing

setScreenUpdate
Description:
Turns on or off screen updates
Parameters
active TRUE to update screen
Return value:
Nothing

setSyntax
Description:
Sets the current syntax highlighting scheme
Parameters
name Name of the syntax scheme
Return value:
Name of scheme

setToolActive
Description:
Set a tool active
Parameters
id ID of the tool
active TRUE or FALSE
Return value:
Nothing

setView
Description:
Set view for current file
Parameters
view ASCIVIEW (0) or HEXVIEW (1)
Return value:
Nothing

snapshot
Description:
DEBUG
Parameters
none
Return value:
Nothing

startMacroRecord
Description:
Start recording a macro.
Parameters
none
Return value:
Nothing

startUndoBlock
Description:
Start an undo block. Operations between this command and endUndoBlock will be undone/redone in a single operation.
Parameters
none
Return value:
Nothing

stringToChar
Description:
Returns the character code for a character.
Parameters
data String where the first char will be converted to it's character code
Return value:
Integer

switchField
Description:
In hex view only: Switch between HEX and ASCII fields.
Parameters
none
Return value:
Nothing

switchExecutingControl
Description:
Execute the code on the control specified. Use this function with caution. If you do not return to the originating control, be sure to release all readers or writer before switching, or a deadlock may occur. The control is not focused, for this use "switchToControl".
Parameters
id Id of the control
Return value:
TRUE if success

switchToControl
Description:
Switch focus to a control.
Parameters
id Id of the control
Return value:
TRUE if success

switchToFile
Description:
Switch focus to a control containing a specific file.
Parameters
filename Filename
Return value:
TRUE if success

tabPressed
Description:
Inserts a tab. Inserts a tab character or spaces depending on settings.
Parameters
none
Return value:
Nothing

textModified
Description:
Callback function. Called when the active textbuffer has been modified
Parameters
modified TRUE if modified
Return value:
Nothing

toDocumentEnd
Description:
Move to file end
Parameters
none
Return value:
Nothing

toDocumentStart
Description:
Move to file start
Parameters
none
Return value:
Nothing

toggleColumnBlock
Description:
Toggle between column block and common block marking.
Parameters
none
Return value:
Nothing

toggleRelativePos
Description:
Toggles between relative position display, and absolute position display.
Parameters
none
Return value:
Nothing

toInt
Description:
Converts a string to an integer, if the string contains a valid numeric string.
Parameters
data String containing an integer, or an integer
Return value:
Integer

toLineEnd
Description:
Move to line end
Parameters
none
Return value:
Nothing

toLineStart
Description:
Move to line start
Parameters
none
Return value:
Nothing

toString
Description:
Move to line start
Parameters
data Integer or string value
Return value:
Nothing

undo
Description:
Undo one step
Parameters
none
Return value:
TRUE if successful

undoAvailable
Description:
Callback function. Called when the active textbuffer has undo available.
Parameters
hasUndo TRUE if undo is available
Return value:
Nothing

unloadModule
Description:
Unload a K-module
Parameters
filename Filename of K-file to unload
Return value:
TRUE if successfull

updateMainMenu
Description:
Reflect changes in the main menu to the display
Parameters
none
Return value:
Nothing

updateSetting
Description:
Update a setting
Parameters
setting One of the following strings:

'autosave': TRUE if auto save should be done.
'backupfiles': TRUE if .BAK file should be created on file save.
'columnblock': Columnblock marking (TRUE/FALSE).
'crlf': TRUE if CR+LF line end sequence should be used, FALSE if LF only.
'hexcursorbg': Colorvalue(RGB) of hex cursor background.
'hexcursorfg': Colorvalue(RGB) of hex cursor.
'hilitebg': Colorvalue(RGB) of highlight background.
'hilitefg': Colorvalue(RGB) of highligt foreground.
'insertmode': TRUE if insert mode, FALSE if overwrite mode.
'leftMarginbg': Colorvalue(RGB) of left margin background.
'leftMarginfg': Colorvalue(RGB) of left margin.
'markerbg': Colorvalue(RGB) of marked position background.
'markerfg': Colorvalue(RGB) of marked position.
'markbg': Colorvalue(RGB) of mark background.
'markfg': Colorvalue(RGB) of mark foreground.
'maxUndoSize': Max number of undo steps.
'optimalfill': TRUE to fill long space runs whith tab character (0x9) when possible..
'persistentblocks': TRUE if persistent blocks should be used.
'reuseExistingBuffer : TRUE if an existing buffer and control should be used instead of reloading when a file is opened.
'rightmargin': The right margin.
'showLeftMarginInfo' : TRUE to show the left margin info.
'showLineNumber' : TRUE to show line numbers in the left margin.
'showSavedPos' : TRUE to show saved position in the left margin. 'standarddelim': Standard delimitor string. (When no syntax highlighting is defined.)
'showrightmargin': TRUE if the right margin should be shown in the text window.
'stripnameinnotebook': TRUE if only filename without path should be displayed in notebook tabs.
'syntaxhighlight': TRUE if syntax highlightinh should be used.
'tabsize': Set the tab size.
'usetab': TRUE to insert real tab character (0x9), FALSE to insert spaces.
update New setting
Return value:
Nothing

window
Description:
DEBUG
Parameters
none
Return value:
Nothing