Home AMX User Forum AMX Technical Discussion

constant string question

Hay guys,

I have this string I send sometimes like this

SEND_STRING device, "27,20,1"

But "27,20,1" is a pain to remember and type out

How do I use a constant for this?

The following does not work:

CONSTANT_HEADACHE = "27,20,0"
SEND_STRING device, CONSTANT_HEADACHE

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    travis wrote: »
    Hay guys,

    I have this string I send sometimes like this

    SEND_STRING device, "27,20,1"

    But "27,20,1" is a pain to remember and type out

    How do I use a constant for this?

    The following does not work:

    CONSTANT_HEADACHE = "27,20,0"
    SEND_STRING device, CONSTANT_HEADACHE

    Here is one way:
    DEFINE_DEVICE
    
    dvTP = 10001:1:0
    
    DEFINE_CONSTANT
    
    CHAR cHEADACHE[] = {27,20,1}
    
    DEFINE_EVENT
    
    BUTTON_EVENT[dvTP,1] {
    
       PUSH: {
          SEND_STRING 0,"cHEADACHE"
       }
    }
    
Sign In or Register to comment.