>Since FSIZE returns the file size in bytes, perhaps Nick meant a different function. The way I'd do it is
>
>this.value = PADL( ALLTRIM( this.value ), '0', 5 )
>
>in the valid().
>
>>>this.value = REPLICATE("0",FSIZE(myfield) - LEN(ALLTRIM(this.value)) ) +
>>>ALLTRIM(this.value)
>>>
>>>in Valid() event probably might help.
>>>
>>>Nick
>>
>>
>> Thanks Nick, but when I run the form, I receive the following error
>>message "Too long sequence bla,bla..."
>> Alano Teles
>Since FSIZE returns the file size in bytes, perhaps Nick meant a different function. The way I'd do it is
>
>this.value = PADL( ALLTRIM( this.value ), '0', 5 )
>
>in the valid().
>
Actually it can return both:
From VFP help
***************************
The current setting of SET COMPATIBLE determines if FSIZE( ) returns the size of a field or a file. If SET COMPATIBLE is set to OFF or FOXPLUS (the default), FSIZE( ) returns the size of a field. If SET COMPATIBLE is set to ON or DB4, FSIZE( ) returns the size of a file.
****************************
but your and Dragan ways do the job too.
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison