Home AMX User Forum AMXForums Archive Threads Tips and Tricks

Escape Codes

This is taken from the discussion on weather websites, but it screamed TIP/TRICK to me.
Not that this changes the performance, but it makes the organization a bit nicer . . . instead of 5 separate dynamic images being defined you can only define 1

currently the 5 images are identical except for the actual file name (" 1L.jpg") in this case.


since ultimately you want to have a button with 5 states, 1 for each image, then you can just use one of the escape sequences to pass along the currently displayed state.


Notice the "1" in the "1L.jpg" has been replaced with the current state escape sequence or $ST. In this way you just assign this single dynamic image to a 5 state button and you will get the same results has 5 separate images.

This is not totally necessary in this case, it helps with organization and it is also easier to assign a single image to 5 states then 5 images to 5 states.

If you search the help file for "Escape Sequences" it will give you a list of all the available codes, the panel resolution, button resolution and button name codes are of particular interest, they were added for use with custom web applications so you easily know what panel was requesting and what size to make the images.

Thanks to Rob Whapham for the original idea for the weather images, and for being supersmart all the time.
Sign In or Register to comment.