Home AMX User Forum NetLinx Studio

What's Wrong with This?

cUICodeEntry[nUI]="cUICodeEntry[nUI],cKPChars[nBut]"
Where
VOLATILE CHAR cUICodeEntry[nTotUIs][4]
VOLATILE CHAR cKPChars[10]={'0','1','2','3','4','5','6','7','8','9'}
I get back a warning of converting string to char.

Any thoughts appreciated. Thanks.

Comments

  • kbeattyAMXkbeattyAMX Posts: 358
    cUICodeEntry[nUI]="cUICodeEntry[nUI],cKPChars[nBut]"
    
    Where
    VOLATILE CHAR cUICodeEntry[nTotUIs][4]
    VOLATILE CHAR cKPChars[10]={'0','1','2','3','4','5','6','7','8','9'}
    
    I get back a warning of converting string to char.

    Any thoughts appreciated. Thanks.
    why not just VOLATILE CHAR cKPChars[]='0123456789'
    this should have been VOLATILE CHAR cKPChars[][1]={'0','1','2','3','4','5','6','7','8','9'}
  • TurnipTruckTurnipTruck Posts: 1,485
    kbeattyAMX wrote: »
    why not just VOLATILE CHAR cKPChars[]='0123456789'
    Because my way is the way I've always done it. Now I know a simpler way!

    However,
    cUICodeEntry[nUI]="cUICodeEntry[nUI],cKPChars[nBut]"
    
    still returns a string to char conversion warning.
  • kbeattyAMXkbeattyAMX Posts: 358
    Because my way is the way I've always done it. Now I know a simpler way!

    However,
    cUICodeEntry[nUI]="cUICodeEntry[nUI],cKPChars[nBut]"
    
    still returns a string to char conversion warning.

    Works fine for me.

    //VOLATILE CHAR cKPChars[]='0123456789'
    //VOLATILE CHAR cUICodeEntry[10][4]
    cUICodeEntry[1] = "cUICodeEntry[1],cKPChars[1]"

    Why do this when you could do...
    cUICodeEntry[1] = "cUICodeEntry[1],itoa(nBut-1)"
    then you don't need the character string.
Sign In or Register to comment.