Shiny Language Reference

Language Reference > User Interface > Memo Boxes


memoboxremoveat

bool memoboxremovetat(int ID, int Pos, int Count);

 

Remove characters from the memobox at the specified position

The MEMOBOXREMOVEAT statement removes the specified number of characters at the specified byte position. To remove all the text in a memobox, refer to the resetmemobox statement.

 

Parameters

ID

The control ID of the control you wish to modify

Pos

The character (byte) position within the memobox to remove 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 remove text at the start of "Line 2", the position parameter should be integer 7.

Count

The number of characters to remove. Remember that line feeds ("\n") are invisible but count as one character.

 

Return Value

TRUE if the removal succeeded, otherwise FALSE. Removal 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");


// Remove "wide" from "Hello big wide World"
bool bRes = memoboxremoveat(iMemoBoxID, 10, 5);