convert variant to integer

AbhishekAbhishek Member Posts: 68
How can we convert variant to integer.

ADORecSet.RecordCount it return variant but how can convert in to integer.please help.thanx in adv
Abhishek Srivastava
Technical Consultant
New Delhi(India )

Comments

  • NagiNagi Member Posts: 151
    If you're trying to count the number of records in any given record set, use Record.COUNT (in your case, ADORecSet.COUNT). This returns a data type integer.

    Whenever you want to convert data into anything other than text, use EVALUATE. You need a variable of the data type you want to convert to (var1) and another variable that you want to test (var2).
    EVALUATE(var1,var2);
    

    Keep in mind that EVALUATE returns a run-time error if the variable you're testing doesn't match the criteria of the data type you want to convert to. Therefore, put EVALUATE in an IF statement to handle any errors.

    I hope this answers your question.

    Cheers!
  • AbhishekAbhishek Member Posts: 68
    sorry we cant use ADORecSet.COUNT.we must use ADORecSet.RecordCount
    Abhishek Srivastava
    Technical Consultant
    New Delhi(India )
  • DenSterDenSter Member Posts: 8,305
    It seems like you read the first sentence and decided the answer was not useful, and didn't even read the rest...

    EVALUATE is what you are looking for. If the variant is an integer it will convert to an integer variable.
Sign In or Register to comment.