Text box character length

arindamarindam Member Posts: 176
Hi All,

I am facing a problem on Navision. The senario :

1. There is a table which have the feilds name, address1, address2.
2. There is a form with 3 text boxex txtName, txtAddress1, txtAddress2.
3. In my table length of address1 is 30 and length of address2 is 30.
4. My address1 text box's length is 40 (this is mandatory, i cant keep the length as 30).
5. Now in a button click I want Navision to display 30 words in address1 text box and remaining 10 (40-30) in address2 text box.

I use PADSTR function, but it is only giving me the first 30 character of address1 text box. I need to store remaining 10 characters from the address1 text box and send it to address2 text box.

Please advice. Thanks in advance.

Arindam

Answers

  • NagiNagi Member Posts: 151
    Maybe something like this...
    TxtToAdr1 := 30;  // Variable type Integer
    
    IF STRLEN(address1) > TxtToAdr1 THEN BEGIN
      txtAddress1 := COPYSTR(address1,1,TxtToAdr1);
      txtAddress2 := COPYSTR(address1,TxtToAdr1 + 1,STRLEN(address1);
    END;
    
  • arindamarindam Member Posts: 176
    Thanks a ton Nagi.

    Your code is working absolutely perfect and that solved my problem.

    Regards,
    Arindam
Sign In or Register to comment.