Stuck on CHAR arrays again
fogled@mizzou
Posts: 549
Thanks so much to everyone that helped me out on my earlier post about CHAR arrays (http://www.amxforums.com/showthread.php?t=2205). I thought I had this more or less figured out, but now I've run into something else that doesn't quite make sense...
For a 16 output Autopatch switch, I've defined a variable CHAR vsw_out[30]. I figured 30 characters should be plenty to account for a handful of active outputs and the spaces that go between them when you actually send the command to the switch (I've actually only used 7 character positions so far). I've got all my ports mapped in DEFINE CONSTANT like projector1 = 5, polycom = 6, etc. I'm also using ELO touchpanels, and those ports are defined as tp1 = 1, tp2 = 2, etc. My touchpanel design 4 video previews that show up on the ELO, and any one of them can be selected as "active". I've got a selection variable for that (active_port), and an array that maps the selection variable to a port (port_map[] = {1,2,3,4}).
Almost everywhere I assign vsw_out to something - usually several ports like:
But now I've just created another assignment for just the single projector port, like this:
Please, can someone tell me what foolish Newbie mistake I'm making this time?
Thanks,
For a 16 output Autopatch switch, I've defined a variable CHAR vsw_out[30]. I figured 30 characters should be plenty to account for a handful of active outputs and the spaces that go between them when you actually send the command to the switch (I've actually only used 7 character positions so far). I've got all my ports mapped in DEFINE CONSTANT like projector1 = 5, polycom = 6, etc. I'm also using ELO touchpanels, and those ports are defined as tp1 = 1, tp2 = 2, etc. My touchpanel design 4 video previews that show up on the ELO, and any one of them can be selected as "active". I've got a selection variable for that (active_port), and an array that maps the selection variable to a port (port_map[] = {1,2,3,4}).
Almost everywhere I assign vsw_out to something - usually several ports like:
vsw_out = "itoa(projector1),' ',itoa(tp1),' ',itoa(polycom)"... or a single port via the active panel array like:
vsw_out = "itoa(port_map[active_port])"... I get no compile errors - everything seems fine.
But now I've just created another assignment for just the single projector port, like this:
vsw_out = "itoa(projector1)"... and I keep getting a compile "ERROR: Illegal assignement statement" message. I don't understand why the itoa(projector1) doesn't give an error when it's combined with other stuff as in the first code snippet, and a different single-port assignment also doesn't give an errror as in the 2nd code snippet, but I am getting an error in the 3rd code snippet.
Please, can someone tell me what foolish Newbie mistake I'm making this time?
Thanks,
0
Comments