Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

StrToInt

edited January 2007 in General
Hi,
I have a string varibale which I want to convert to an Interger/Double, so
that I can use it to calculate something.
I have tried to take the variable and convert like so:

Value := StrToInt(Variable16.Value);

But that doesnt work.

The string in variable 16 is being fed from a sub report - thatas why its
in string format. I cant take values from a subreport in integer format.

help please!

thanks
Redmond

Comments

  • edited January 2007
    Hi Redmond,

    Since the TppVariable.Value property is a variant type, you should not have
    to convert it from a string. I believe the variant class will recognize if
    the value is not a valid number and throw an exception if it isn't.

    Value := Variable16.Value...

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2007

    Try using TryStringToInt() so you don't need to catch an exception.

    What happens?
This discussion has been closed.