Support and General Use > Theming and Appearance Customization
Allow upto 512 images on a WPS
kahuna_999:
I have found a problem with the ‘overloading’ of the %xp tag ( %xpa|srcx|srcy|w|h and %xpa|srcx|srcy|w|h|x|y ).
Because of the optional x,y parameters, it becomes very difficult to check for when used in conditionals.
%?pv - this will fail as it expects to find a trailing '|'. (coding assumption)
%?pv - this wont fail, but will have three conditional options
%?pv - this wont fail, but is it two conditionals( first %xp command with x,y cords), or is it 4, an %xp, 10, 10, %xp..
The only safe way I can see around this is to have two new tags, one with the x,y coords, one without..
%xp|srcx|srcy|w|h
%xx|srcx|srcy|w|h|x|y
Any suggestions on the second tag, could be %xx or %xP, or %xpxy
Alternatively, could the syntax for tag parms be changed to use ',' (comma) rather than '|' (or). The 'or' would still make sense for separating the options in conditionals.. ie %?pv
Hopefully that made sense
kahuna_999:
I decided to go with two tags for now...
%xp|srcx|srcy|w|h
%xx|srcx|srcy|w|h|x|y
Patch updated in tracker
Below is an example showing a sixteen step volume knob...
%xl|r|vol_knob.bmp|150|100|
%?pv
[EDIT by NicolasP: Added a few spaces to allow wrapping]
Here is the bitmap used...
Lear:
--- Quote from: kahuna_999 on June 13, 2007, 06:07:41 AM ---I have found a problem with the ‘overloading’ of the %xp tag ( %xpa|srcx|srcy|w|h and %xpa|srcx|srcy|w|h|x|y ).
Because of the optional x,y parameters, it becomes very difficult to check for when used in conditionals.
%?pv - this will fail as it expects to find a trailing '|'. (coding assumption)
%?pv - this wont fail, but will have three conditional options
%?pv - this wont fail, but is it two conditionals( first %xp command with x,y cords), or is it 4, an %xp, 10, 10, %xp..
The only safe way I can see around this is to have two new tags, one with the x,y coords, one without..
%xp|srcx|srcy|w|h
%xx|srcx|srcy|w|h|x|y
Any suggestions on the second tag, could be %xx or %xP, or %xpxy
Alternatively, could the syntax for tag parms be changed to use ',' (comma) rather than '|' (or). The 'or' would still make sense for separating the options in conditionals.. ie %?pv
--- End quote ---
Yes, it is unfortunate that '|' has been used as tag parameter separator, but as it was only used for tags that didn't really need to be in conditionals, it hasn't been much of a problem until now.
But even if separate tags are used, as suggested above, will that really work for dynamic enums (like the volume and battery level)? At least before the tokenizing re-write, the code would just parse the enum parts to figure out how many options were used; '|' as a part of a non-enum tag would confuse it.
So I'd definitely suggest you use another separator char. If you can find one that isn't used by conditionals, and is safe for use with the other parameter tags (including stuff like album art), that'd be nice. I'm not suggesting that we should change the other tags now, but making it possible would be good.
pixelma:
I agree from a wps writer point of view.
The example line not only is "confusing" the wps parser but also people who read or write such a line.
It's really hard to find out where the next conditional case starts and what still belongs to the bitmap part tag, very error-prone.
Llorean:
I'd prefer xp and xP personally, as opposed to xp and xx. Since they're essentially two variants of the same tag.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version