Home AMX User Forum AMX Control Products

multiple send commands

Just a quick question that I could be answer myself if I had a TP infront of me.

Can a SEND_COMMAND send more than one command in a single command.
SEND_COMMAND dvTP,"'@PPX PPON-PAGE PPON-ANOTHERPAGE'"

I'm guessing not, but like I say without a panel in front of me to test it on today I just can't wait!!!!

Feel free to flame me if I'm being an idiot!

If not, however it would be a useful future feature in my eyes for code optimisation etc...

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    mshunt wrote: »
    I'm guessing not
    You guessed right.
  • ericmedleyericmedley Posts: 4,177
    mshunt wrote: »
    Just a quick question that I could be answer myself if I had a TP infront of me.

    Can a SEND_COMMAND send more than one command in a single command.
    SEND_COMMAND dvTP,"'@PPX PPON-PAGE PPON-ANOTHERPAGE'"
    

    I'm guessing not, but like I say without a panel in front of me to test it on today I just can't wait!!!!

    Feel free to flame me if I'm being an idiot!

    If not, however it would be a useful future feature in my eyes for code optimisation etc...

    it doesn't hurt to send two commands right on top of each other. Most AMX devices can buffer the commands.

    So
    SEND_COMMAND dvTP,"'@PPX PPON-PAGE"
    SEND_COMMAND dvTP,"'@PPON-ANOTHERPAGE'"
    

    You can even put them on the same line if it makes you feel better

    SEND_COMMAND dvTP,"'@PPX PPON-PAGE"  SEND_COMMAND dvTP,"'@PPON-ANOTHERPAGE'"
    
  • mshuntmshunt Posts: 23
    Thanks for the replies,

    Like I said I thought not, It would just be a nice feature if you could group a number of commands to the same device in the same SEND_COMMAND

    Perhaps that's a feature for Netlinx 4!
  • jjamesjjames Posts: 2,908
    You can send BMF commands, which can change multiple attributes of a single button though. So it's KINDA like you can. :D
  • a_riot42a_riot42 Posts: 1,624
    mshunt wrote: »
    Thanks for the replies,

    Like I said I thought not, It would just be a nice feature if you could group a number of commands to the same device in the same SEND_COMMAND

    Perhaps that's a feature for Netlinx 4!

    I don't really see how that's a feature. You can send multiple commands, you just can't send them in one send_command statement. Given that the syntax can get ugly with quotes and commas, etc, putting many commands in one send_command would be more effort with no gain.
    Paul
  • jjamesjjames Posts: 2,908
    a_riot42 wrote: »
    I don't really see how that's a feature. You can send multiple commands, you just can't send them in one send_command statement. Given that the syntax can get ugly with quotes and commas, etc, putting many commands in one send_command would be more effort with no gain.
    Paul
    As I stated above, they do it with BMF - and while it can get hairy - it's sometimes useful, particularly with the iPad when sending multiple commands. It doesn't parse the commands as quickly as an 8400 or any other native device.

    Granted I understand we're talking about two different things, but the idea is the same. :D
  • DHawthorneDHawthorne Posts: 4,584
    I find, just to be able to read my code later, it's easier just to send multiple lines. A big, convoluted BMF can get way to hard to parse in human terms.
  • jjamesjjames Posts: 2,908
    DHawthorne wrote: »
    I find, just to be able to read my code later, it's easier just to send multiple lines. A big, convoluted BMF can get way to hard to parse in human terms.

    I would agree, but you can break it out to separate lines like so:
    send_command dvTp,"	'BMF-100,0,',
    			'%R1,3,4,5,'	// Set rectangle.
    			'%B,None,'	// Set the Border Style name.
    			'%TSomeText'"	// Set Text using ASCII characters
    
    See? Multiple lines - haha! :D
  • viningvining Posts: 4,368
    jjames wrote: »
    send_command dvTp,"	'BMF-100,0,',
    			'%R1,3,4,5,'	// Set rectangle.
    			'%B,None,'	// Set the Border Style name.
    			'%TSomeText'"	// Set Text using ASCII characters
    
    That's actually how I use it when I use it. You almost have to in order to make sense of it.
    SEND_COMMAND dvUI_Arry[iUI_Indx],"'^BMF-321,1,%CB',BG_BTN_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%CF',BG_FILL_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%CT',BG_TXT_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%EC',BG_TXT_EFF_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%JB0 -200,-692',
    					     ',%P',BG_PIC_ARRY[nUI_PicsArry[iUI_Indx]]" ;
    
  • HedbergHedberg Posts: 671
    vining wrote: »
    That's actually how I use it when I use it. You almost have to in order to make sense of it.
    SEND_COMMAND dvUI_Arry[iUI_Indx],"'^BMF-321,1,%CB',BG_BTN_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%CF',BG_FILL_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%CT',BG_TXT_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%EC',BG_TXT_EFF_COLOR_ARRY[nUI_PicsArry[iUI_Indx]],
    					     ',%JB0 -200,-692',
    					     ',%P',BG_PIC_ARRY[nUI_PicsArry[iUI_Indx]]" ;
    


    smash it all together in one, really large, incomprehensible line, that's what I do. There's job security in write only code, you know.



    That's a joke, of course. There used to be a contest among C language programmers to write the most incomprehensible code to do something like print out 'hello world.' This was back in like 96 or so. Some of the entries were stunning, to say the least. I was never very good at that sort of thing as I was primarily interested in writing Fortran code at the time. Writing Fortran code became particularly lucrative as year 2000 approached. It paid to be a dinosaur back then.

    edit: found the link on the first try:http://www.ioccc.org/
  • a_riot42a_riot42 Posts: 1,624
    Even if they had the multiple commands in one send_command feature available, it would quickly run into the send_command character limit which is something that is dire need of fixing. There's no advantage to that feature with the character limit being so low.
    Paul
  • jjamesjjames Posts: 2,908
    a_riot42 wrote: »
    Even if they had the multiple commands in one send_command feature available, it would quickly run into the send_command character limit which is something that is dire need of fixing. There's no advantage to that feature with the character limit being so low.
    Paul
    Good point.
Sign In or Register to comment.