Shiny Language Reference
Language Reference > User Interface > Memo Boxes
memoboxinsertat
bool memoboxinsertat(int ID, int Pos, string Text);
Inserts a string into the memobox at the specified position
The MEMOBOXINSERTAT statement inserts the specified text into the memobox at the specified byte position. To insert text before the first character in the control, specify integer 0 for the position parameter.
Parameters
ID
The control ID of the control you wish to modify
Pos
The character (byte) position within the memobox to insert the new text at. Remember that the byte position includes single bytes for line feeds (newlines, "\n"). Therefore a caption string of "Line 1\nLine 2" will only display 12 characters on screen, but consists of 13 bytes. Therefore to insert text at the start of "Line 2", the position parameter should be integer 7.
Text
The string to insert
Return Value
TRUE if the insertion succeeded, otherwise FALSE. Insertion will only fail if an invalid position has been specified.
Example Code
// Create the memo box X: 10, Y:10 and sized 150*70
int iMemoBoxID = creatememobox(1, 10, 10, 150, 70);
// Set the memobox text to "Hello World"
setcaption(iMemoBoxID, "Hello World");
// Insert "big wide" between "Hello" and "World"
bool bRes = memoboxinsertat(iMemoBoxID, 5, " big wide");