The year (4 digit) is uploaded to an AS400 system for auto policies. The original app is written in FPD26 and converts the year (i.e. 1985) to a two-digit code using the code below. Since the tables are accessed from both the original app and the new VFP app, the codepage is set to 437 on the tables. The problem is in the code below. It converts correctly until you read or write the conversion to the table and then Foxpro converts it again. I need a way to convert it where it can be read from fpd26 and vfp from tables with a codepage set to 437.
TIA
Tracy
>Tracy,
>
>What is this function supposed to do?
>
>>Any ideas how to do the following without going over 128 in VFP? What about accessing pre-existing data in tables that is already stored using this method in FPD26a?
>>
>>valyear=1985
>>*PARAMETER valyear
>>
>>PRIVATE xreturn, stryear
>>xreturn = ' '
>>
>>*---Store with the new method if the century is included
>>
>>IF TYPE('valyear') = 'N'
>> stryear = TRANS(valyear,'@L 9999')
>>
>> IF LEFT(stryear,2) = '00'
>> xreturn = TRANS(valyear,"99")
>> ELSE
>> xreturn = CHR(VAL(LEFT(stryear,2))+58) + CHR(VAL(RIGHT(stryear,2))+33)
>> ENDIF
>>ENDIF
>>
>>RETURN xreturn
>>
>>TIA,
>>Tracy
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"