The Haxial Programming Language
MText Module
Contents
Description
SetinDstTxt, inSrcTxt AppendinDstTxt, inSrcTxt AppendRepeatedinDstTxt, inSrcTxt, inCount AppendCharinTxt, inChar AppendRepeatedCharinTxt, inChar, inCount AppendLineBreakinTxt AppendTabinTxt AppendSpaceinTxt AppendIntinTxt, inIntVal, inOptions AppendDecIntinTxt, inIntVal AppendFloatinTxt, inVal, inOptions AppendTimeinTxt, inTimeStamp, inOptions AppendByteSizeinTxt, inByteSize, inOptions
InsertinDstTxt, inAtOffset, inSrcTxt InsertRepeatedinDstTxt, inAtOffset, inSrcTxt, inCount InsertCharinTxt, inAtOffset, inChar InsertRepeatedCharinTxt, inAtOffset, inChar, inCount ReplaceinDstTxt, inAtOffset, inExistingSize, inSrcTxt
RemoveinTxt, inAtOffset, inSize ClearinTxt ClearAndReuseinTxt TruncateinTxt, inNewSize GetSizeinTxt, outSize IsEmptyinTxt, outResult IsNotEmptyinTxt, outResult PreallocateinTxt, inSize FreeUnusedMemoryinTxt MoveinTxt, inToOffset, inFromOffset, inSize
EqualinTxtA, inTxtB, inOptions, outEqual CompareinTxtA, inTxtB, inOptions, outComparison BeginsWithinTxt, inBeginTxt, inOptions, outResult EndsWithinTxt, inEndTxt, inOptions, outResult
FindinTxt, inStartOffset, inTxtToFind, inOptions, outOffset FindCharinTxt, inStartOffset, inChar, inOptions, outOffset ContainsinTxt, inTxtToFind, inOptions, outResult
ToIntegerinTxt, inOptions, outNum ToFloatinTxt, inOptions, outNum
StoreCharinTxt, ioOffset, inChar LoadCharinTxt, ioOffset, outChar CountCharsinTxt, outCount CountBytesinTxt, inMaxCharCount, outByteCount, outCharCount
ChangeCasesrcTxt, dstTxt, inStyle RemoveLeadTrailWhiteSpacesrcTxt, dstTxt RemoveTruncatedCharinTxt FixLineBreakssrcTxt, dstTxt, inOptions
Description

The MText module provides text objects that can contain a changing amount of text. Commands can be invoked to manipulate/modify the text. MText is suitable for constructing a body of text by appending a piece at a time.

MText uses Unicode, an industry standard allowing computers to consistently represent and exchange text in any of the world's writing systems and languages. Unicode defines more than 100 000 different characters, providing a standardized digital representation for each.

Internally, MText stores the text in 1 of 3 Unicode formats:

The maximum amount of text that can be stored in a text object is an indefinitely large amount. Storing a megabyte of text is no problem. Storing 100 megabytes of text is theoretically possible but would probably be slow, inefficient, and impractical.

The text objects store only plain text. They do not store "rich" text with various styles such as different colors, fonts, bold, italic etc.

MText::Create
Parameters:
outTxtRTextThe variable to receive the reference to the new text object.
Description:
This command creates an empty text object, and sets the specified variable to contain a reference to the new text object.

**** TO DO: How to create a text object in UTF16 format, rather than the default UTF8 format.
Pedantic Details:
MText::Append
Parameters:
inDstTxtRTextA reference to a text object to modify.
inSrcTxtRTextA reference to a text object to copy text from.
Description:
This command appends the contents of the inSrcText object to the inDstTxt object.
Pedantic Details:
Errors:
MText::kError::NullObjectinDstTxt is a null reference (no text object).
MText::kError::IncorrectObjectTypeThe inDstTxt or inSrcTxt object is not an MText object.
MText::kError::InvalidSubsetThe subset range of the inDstTxt reference starts or ends beyond the end of the text.
MText::kError::MaxLimitAdding the new text to the inDstTxt object would exceed the maximum size of a text object.
MMemory::kError::InsufficientThere is not enough free memory to add the text to the inDstTxt object.
MText::AppendChar
Parameters:
inTxtRTextA reference to a text object to modify.
inCharcharThe Unicode number of the character to append.
Description:
This command appends a character to the specified text object. Characters are specified by number. For example, in the Unicode standard, the latin capital letter 'A' is number 65 (hex 0x41), and the infinity symbol is number 8734 (hex 0x221E).
Pedantic Details:
Errors:
MText::kError::NullObjectinTxt is a null reference (no text object).
MText::kError::IncorrectObjectTypeThe inTxt object is not an MText object.
MText::kError::InvalidSubsetThe subset range of the inTxt reference starts or ends beyond the end of the text.
MText::kError::MaxLimitAdding the new character to the text would exceed the maximum size of a text object.
MMemory::kError::InsufficientThere is not enough free memory to add the character to the text.
MText::AppendInt
Parameters:
inTxtRTextA reference to a text object to modify.
inIntValintThe integer value to append.
inNumFmtuint32 or
RNumberFormat
Number format options, or reference to a number format object.
Description:
This command converts an integer value (a whole number) to text and appends it to the specified text object. The inNumFmt parameter controls how the integer value is converted to text. It can be number formatting options, or it can be a reference to a number format object that you created for full/precise/customized control over the formatting.

**** TO DO: Document the number format options. Document number format objects.
Pedantic Details: