INIT
DB_Digit(1, "1");
DB_Digit(2, "2");
DB_Digit(3, "3");
DB_Digit(4, "4");
DB_Digit(5, "5");
DB_Digit(6, "6");
DB_Digit(7, "7");
DB_Digit(8, "8");
DB_Digit(9, "9");
DB_Digit(0, "0");
KB
PROC
ITS_MakeResult((STRING)_val)
THEN
ClearResults();
DB_Result(_val);
PROC
ClearResults()
AND
DB_Result(_val)
THEN
NOT DB_Result(_val);
PROC
IntegerToString((INTEGER)_int)
THEN
ITS_DivideByTen(_int, "");
PROC
ITS_DivideByTen((INTEGER)_int,(STRING)_str)
AND
IntegerDivide(_int, 10, _quot)
AND
_quot < 1
THEN
ITS_GetDigit(_int, _str);
PROC
ITS_DivideByTen((INTEGER)_int,(STRING)_str)
AND
IntegerDivide(_int, 10, _quot)
AND
_quot > 0
AND
IntegerModulo(_int, 10, _ret)
AND
DB_Digit(_ret, _aStr)
AND
StringConcatenate(_aStr, _str, _nStr)
THEN
ITS_DivideByTen(_quot, _nStr);
PROC
ITS_GetDigit((INTEGER)_int, (STRING)_str)
AND
DB_Digit(_int, _ITS)
AND
StringConcatenate(_ITS, _str, _finalString)
THEN
ITS_MakeResult(_finalString);