Text to Integer

tompynationtompynation Member Posts: 398
How can i convert a variable of type Text to an Integer?

In Example:
lv_Filter is a Text field,
lv_FilterCode is a Text field

Now i would like to add the lv_FilterCode as a filter for an Integer field... How do i do this?

FILTERGROUP(4);
lv_Filter := GETFILTERS;
lv_FilterCode := COPYSTR(lv_Filter, 5, STRLEN(lv_Filter));
FILTERGROUP(0);

lv_ReceptITem.RESET;
lv_ReceptItem.SETRANGE(lv_ReceptItem.ReceptID,lv_FilterCode);

I get error on the line in Bold : Type Conversion: ==> Integer := Text :?:

Comments

  • BBlueBBlue Member Posts: 90
    EVALUATE(varInt, lv_FilterCode);
    lv_ReceptItem.SETRANGE(lv_ReceptItem.ReceptID,varInt);
    
    //Bogdan
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    use EVALUATE function :wink:
    for details see C/SIDE Reference guide help
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • FramusFramus Member Posts: 13
    And what about the function EVALUATE?
  • tompynationtompynation Member Posts: 398
    thx, solved it with the evaluate function...

    How do you guys search in the help if you dont know the function you need??

    I was looking in help for:

    - Text to Integer
    - Cast
    - FORMAT

    But non of these searches brought me to evaluate function
Sign In or Register to comment.