Easy one := Can i convert text to int?

DannyDanny Member Posts: 10
edited 2010-08-12 in Navision Financials
This is an easy one im sure but can i convert text to an integer.

ie the opposite of format

like the VAL function in VB (i think its VAL)

Any help much appreciated

<img border="0" title="" alt="" src="images/smiles/icon_cool.gif" />

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Look at the EVALUATE function.

    eg.:
    txtTextfield := '123';
    IF NOT(EVALUATE(intNumber,txtTextfield)) THEN
    ERROR('Error occured');

    And yes, this was an easy one <img border="0" title="" alt="" src="images/smiles/icon_wink.gif" />
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • DannyDanny Member Posts: 10
    thanks Luc
    Much appreciated - i knew it would be easy
  • bangswitbangswit Member Posts: 265
    how about this?
    i want to insert field DF."3-Line Item Number" (integer type) from LineNumber
    so the Line number should be text or integer?

    this is my code
    Linenumber := COPYSTR(vstring3,4,6);
    DF."3-Detail Tag" := 'DET';
    DF."3-Line Item Number" := EVALUATE(LineNUmber,vstring3);
Sign In or Register to comment.