Hi BchM,
You can declare a local/global variable using var keyword as shown below:
var
RepCheck: Report "Check";
NoText: array[2] of Text;
AmountInWords: Text;
In your case, as you want to display the amount in words the above global variable will help you, the above-mentioned variables are described as follows:
(1) RepCheck is a variable of Report DataType Named as "Check" which is 1401.
(2) NoText is a variable of DataType "Text" with array Dimension value as 2 which is defined as shown above.
(3) AmountInWords is a variable of DataType "Text" which will store final result of amount in words.
After declaring the global variables, now you can write your code in OnAfterGetRecord() trigger of DataItem in case of a report or wherever you want to use..
trigger OnAfterGetRecord()
var
begin
RepCheck.InitTextVariable();
RepCheck.FormatNoText(NoText, yourDecimalAmountValueFieldOrVariable, CurrencyCode);
AmountInWords := NoText[1];
end;
Now you will have the amount in word in your AmountInWord variable.