Home AMX User Forum NetLinx Studio

Converting Long to Integer

I created a long to hold a maximum number of seconds, and now I want to convert it into hours. How do I do that? I get a compiler error stating ERROR: converting type[long] to [integer]. I was going to try and just leave the value a LONG, but I don't think I can convert a long to ascii, can I? I need to update variable text fields.

Comments

  • PhreaKPhreaK Posts: 966
    No need ITOA() takes a long as an argument.

    However in the future if you're wanting to stuff a value into an integer that was originally stored as a long and you're absolutely certain that it is less than 65535 (2^16) you can use TYPE_CAST()
  • vegastechvegastech Posts: 369
    Ah yes...Type-cast. That worked beautifully. Thanks!
Sign In or Register to comment.