Home AMX User Forum AMX Technical Discussion

TimeLine, Time Change from Module (getting a warning)

Hi All,

I'm trying to do a timeline long time change in a module

if(find_string(data.text,'POLL',1))
{
remove_string(data.text,',',1)
lTL_Polling_Times[1]=atol(data.text)
}

can someone point me why how to solved this warning error.

WARNING: : C10571: Converting type [SINTEGER] to [LONG]

thanks

Comments

  • I'm guessing your ITL_Polling_Times is an Signed Integer array, not a long... If you're getting the results you want, simply put the ATOL expression in a TYPE_CAST() to remove the compiler warning.
  • ericmedleyericmedley Posts: 4,177
    The return from ATOI() is a SLONG. you'll need to do an ABS_VALUE() to make the warning go away
    so -
    lTL_Polling_Times[1]=abs_value(atol(data.text) )
  • It sounds like your ITL_Polling_Times is defined as a LONG. To eliminate the warning, use this:
    ITL_Polling_Times[1] = Type_Cast(atol(data.text));
    This will work fine as long as you can be sure that data.text never contains a negative number. You could add a test for this before assigning the value to your variable.

Sign In or Register to comment.