shahromi
25th June 2014, 12:17
Hi all,
I'm using CMG standard program script to print cheque. Customize the layout & report script to suit our requirement. However for text.wrapping function, the amount description is not displayed correctly:
Example:
199133.25
Result:
ONE HUNDRED NINETY NINE THOUSAND ONE THREE
HUNDRED THIRTY AND TWENTY FIVE CENTS ONLY
The amount description should be:
ONE HUNDRED NINETY NINE THOUSAND ONE HUNDRED
THIRTY THREE HUNDRED AND TWENTY FIVE CENTS ONLY
Using this function:
function text.wrapping()
{
domain tcmcs.st150m Desc
long Len_Desc ,i,LenT_Str
amount.desc1 = " "
amount.desc2 = " "
|amount.desc3 = " "
Desc = toupper$(amount.desc)
Len_Desc = Len(Desc ) | --- 68 chars
for i=1 to Len_Desc
pos_space = pos(Desc , " ") |--- 10 space
if pos_space > 1 then
LenTemp = len(Desc ) - (pos_space - 1) |100-9
Len1 = len(Desc ) - LenTemp
T_Str = Desc (1 ; Len1)
Desc = Desc (pos_space + 1 ; Len_Desc - pos_space)
LenT_Str = Len(T_Str)
Else
T_Str = Desc
LenT_Str = Len(T_str)
endif
If (Len(amount.desc1)+LenT_Str+5) < 45 then
if amount.desc1 <> "" then
amount.desc1 = amount.desc1 & " " & T_str
else
amount.desc1 = amount.desc1 & T_str
endif
Else
if amount.desc2 <> "" then
amount.desc2 = amount.desc2 & " " & T_str
else
amount.desc2 = amount.desc2 & T_str
endif
Endif
i = i + LenT_Str
endfor
}
Anybody can help me.
Thank you very much.
I'm using CMG standard program script to print cheque. Customize the layout & report script to suit our requirement. However for text.wrapping function, the amount description is not displayed correctly:
Example:
199133.25
Result:
ONE HUNDRED NINETY NINE THOUSAND ONE THREE
HUNDRED THIRTY AND TWENTY FIVE CENTS ONLY
The amount description should be:
ONE HUNDRED NINETY NINE THOUSAND ONE HUNDRED
THIRTY THREE HUNDRED AND TWENTY FIVE CENTS ONLY
Using this function:
function text.wrapping()
{
domain tcmcs.st150m Desc
long Len_Desc ,i,LenT_Str
amount.desc1 = " "
amount.desc2 = " "
|amount.desc3 = " "
Desc = toupper$(amount.desc)
Len_Desc = Len(Desc ) | --- 68 chars
for i=1 to Len_Desc
pos_space = pos(Desc , " ") |--- 10 space
if pos_space > 1 then
LenTemp = len(Desc ) - (pos_space - 1) |100-9
Len1 = len(Desc ) - LenTemp
T_Str = Desc (1 ; Len1)
Desc = Desc (pos_space + 1 ; Len_Desc - pos_space)
LenT_Str = Len(T_Str)
Else
T_Str = Desc
LenT_Str = Len(T_str)
endif
If (Len(amount.desc1)+LenT_Str+5) < 45 then
if amount.desc1 <> "" then
amount.desc1 = amount.desc1 & " " & T_str
else
amount.desc1 = amount.desc1 & T_str
endif
Else
if amount.desc2 <> "" then
amount.desc2 = amount.desc2 & " " & T_str
else
amount.desc2 = amount.desc2 & T_str
endif
Endif
i = i + LenT_Str
endfor
}
Anybody can help me.
Thank you very much.