if(Year (PrintDate) > 2500) then
d := Date (Year (PrintDate)+543,Month (PrintDate) ,Day (PrintDate) )
else if (Year (PrintDate) < 2500) then
d := Date (Year (PrintDate), Month (PrintDate) ,Day (PrintDate) )
else d := PrintDate;
Local StringVar y;
y:= Totext(d,"dd MM yyyy");
if(mid(y,4,2)="01") then
Replace (y," 01 "," มกราคม ")
else if(mid(y,4,2)="02") then
Replace (y," 02 "," กุมภาพันธ์ ")
else if(mid(y,4,2)="03") then
Replace (y," 03 "," มีนาคม ")
else if(mid(y,4,2)="04") then
Replace (y," 04 "," เมษายน ")
else if(mid(y,4,2)="05") then
Replace (y," 05 "," พฤษภาคม ")
else if(mid(y,4,2)="06") then
Replace (y," 06 "," มิถุนายน ")
else if(mid(y,4,2)="07") then
Replace (y," 07 "," กรกฎาคม ")
else if(mid(y,4,2)="08") then
Replace (y," 08 "," สิงหาคม ")
else if(mid(y,4,2)="09") then
Replace (y," 09 "," กันยายน ")
else if(mid(y,4,2)="10") then
Replace (y," 10 "," ตุลาคม ")
else if(mid(y,4,2)="11") then
Replace (y," 11 "," พฤศจิกายน ")
else if(mid(y,4,2)="12") then
Replace (y," 12 "," ธันวาคม ")
else
y:= Totext(d,"dd MM yyyy");