How do I cast or convert an Integer to a Word ?
Posted on 2000-03-22
Consider the following procedure:
tyear, tmonth, tday : word;
tyear := word(Year);
tmonth := word(Month);
tday := word(Day);
DecodeDate(IncMonth(CalendarDate, -12), tyear,tmonth,tday);
Is there some way I can perform the cast INSIDE the DecodeDate function call?
It would look something like this:
DecodeDate(IncMonth(CalendarDate, -12), word(Year), wor(Month), word(Day));
Now, the attempt to cast while inside the DecodeDate function call [in my "modified" procedure] doesn't compile. I get some error about "Constant object cannot be passed as var parameter". Can I perform the cast as I am attempting in some other fashion? I hate to use up three variables just as place holders like I am doing in the first procedure.