>>>>>>You can try this in lostfocus
>>>>>>this.value = substr(this.value,1,1)+;
>>>>>> padl(val(substr(this.value,2)),5,"0")
Inputmask would be something like "A99999" and format "!".
>>>>
>>>>>Change lostfocus code to :
this.value = substr(this.value,1,1)+;
>>>>> padl(substr(trim(this.value),2),5,"0")
>>>
>>>TRANSFORM("@L 999999",XXX) pads XXX representation with zeroes; I would try to use that instead of PADL().
>
>>Federico,
>>You can use many routines for conversion. However here transform() doesn't seem to be a shorter (or faster - if ever a lostfocus like this one needs optimizing) coding to me. Maybe I could see why it's better if you provide full code.
>
>I just prefer using TRANSFORM(); since FP gives us a way to pad numbers with zeroes automatically, I don't like (want) my programmers to reinvent the wheel or use (possibly) more obscure methods. My code would be
This.Value = LEFT(This.Value,1)+TRANSF("@L 99999", VAL(SUBSTR(THIS.VALUE,2))
>
>I think I read somewhere that in FP there are at least three ways to do anything; I (let's emphasize that "I") just prefer the least involved way.
OK I missed a nonobscure built-in function and reinvented the padl(). I missed it doesn't even cause coding error as I did in first reply. I was wrong I confess. Sure at least 3 ways or no way :)
Cetin