Home AMX User Forum AMXForums Archive Threads Tips and Tricks

Escape Codes

Spire_JeffSpire_Jeff Formerly Caffeinated ProgrammerPosts: 1,917
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.

http://image.weather.com/looper/archive/us_dtw_closeradar_large_usen/1L.jpg?1135357187796

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.

http://image.weather.com/looper/archive/us_dtw_closeradar_large_usen/$STL.jpg?1135357187796

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.