Options

how to format textboxes

daroondaroon Member Posts: 35
edited 2002-02-09 in Navision Financials
Hi

i`ve got a small prob

how could i format a number in a text box

we had to enter a number with lengh of 1 to 4 items ( from 1 to 9999) but the number in the field had to be 6 chars of lengh and on the begining there are always zeros like 002345 or 000025. How could i say the text box to fill the number with zeros until a lengh of 6 chars ??


thanx for helpin me

Comments

  • Options
    wonmowonmo Member Posts: 139
    There may very well be a simpler way to do this but this will work. Attach code to the OnValidate() trigger of the form:


    CLEAR(FillerText);

    FOR x := 1 TO (6 - STRLEN(Text)) DO BEGIN
    FillerText := FillerText + '0';
    END;

    Text := FillerText + Text;
  • Options
    daroondaroon Member Posts: 35
    Many many thanks for helpin me

    What a simple idea <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />)

    Greetz

    Ronnie
Sign In or Register to comment.