BOOL32 __stdcall tblSetCellTextA(ITBL Table, int32_t Row, int32_t Col, int32_t HAlign, int32_t VAlign, const char* Text, uint32_t Len);
BOOL32 __stdcall tblSetCellTextW(ITBL Table, int32_t Row, int32_t Col, int32_t HAlign, int32_t VAlign, const wchar_t* Text, uint32_t Len);
function tblSetCellTextA(const Table: ITBL; Row, Col, HAlign: TTextAlign; VAlign: TCellAlign; const Text: PAnsiChar; Len: Cardinal): LongBool; stdcall;
function tblSetCellTextW(const Table: ITBL; Row, Col, HAlign: TTextAlign; VAlign: TCellAlign; const Text: PWideChar; Len: Cardinal): LongBool; stdcall;
Purpose. Set a cell's text content and alignment.
Description. Verified real signature oddity: Row, Col, and HAlign are all declared with the SAME type, TTextAlign (an alignment enum), per the exact interface declaration (Row, Col, HAlign: TTextAlign) — despite Row/Col being used as plain integer row/column indices in the implementation (each is cast via Integer(Row)/Integer(Col) before use). This is very likely a declaration typo carried through from the original header (a Pascal/C multi-identifier-one-type declaration where Row/Col should have been typed Integer like every other cell function's row/column parameters, e.g. tblSetCellImage's Row, Col: Integer) rather than a deliberate design — but it is the real, verified ABI as compiled: a strict C binding must pass ordinary integers cast to the TTextAlign enum's underlying type for Row/Col, which works in practice since enum ordinals are plain integers, but is a genuine surface-level inconsistency worth knowing about if generating bindings from the header mechanically. Len: 0 means "read Text as a null-terminated string"; a positive Len reads exactly that many bytes/chars (allowing embedded nulls / avoiding a length scan).
Parameters.
| Parameter | Description |
|---|---|
Table | Target table handle. |
Row, Col | 0-based cell coordinates — declared as TTextAlign in the ABI, used as plain integers internally. |
HAlign, VAlign | Horizontal/vertical text alignment within the cell. |
Text | The text; W variant silently truncates to Latin-1 (low byte of each UTF-16 code unit only — see the chapter-wide finding above). |
Len | 0 = null-terminated; > 0 = exact length. |
Return value. True if Row/Col are in range for the table's current dimensions.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Misc
tblSetCellTextA
tblSetCellTextW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.