TimeLine, Time Change from Module (getting a warning)

RaphayoRaphayo Junior MemberPosts: 111
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

  • zack.boydzack.boyd Smacks Keyboard Repeatedly Posts: 94
    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 Senior Member - 3709 Posts Posts: 4,151
    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) )
  • HARMAN_LLandaetaHARMAN_LLandaeta Professional Services Group Posts: 3

    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.