Home AMX User Forum NetLinx Studio

single integer from integer array?

Sorry to come crying to the forum with what I think is another simple misunderstanding of syntax or something. But I'm having trouble getting a single integer from an integer array. The integer array is defined as: intarray[3], and the programming that populates it limits each integer in the array to 0-9. I just need to convert that to a single integer after I'm done. Is there an easier/better way than this:
mysingleint = atoi("itoa(intarray[1]),itoa(intarray[2]),intarray[3])")

???

Comments

  • mpullinmpullin Posts: 949
    is this ok?
    mysingleint = intarray[1]*100 + intarray[2]*10 + intarray[3];
    
Sign In or Register to comment.