Avoiding Embedded Flag conflicts

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Avoiding Embedded Flag conflicts

Postby Brent Rose » Sun Jul 22, 2012 11:58 pm

I would like to disable embedded flags in VPE. Can this be done currently, or can this facility be added please?

The problem is that a leading "[" character is relatively common in the situation I am dealing with, so strings are sometimes not being output correctly. Users cannot simply enter "[[" instead because this would then corrupt non-VPE usage of this data (and is an unreasonable solution in any case).

Currently, I would have to parse every single string output by VPE looking for either a leading "[" or "[[" to ensure that it is interpretted correctly... which is clearly far from ideal. The fact that VPE is having to parse every single output string for this reason is bad enough...

"[" does seem to be too easy a trigger for emdedded flags - it effectively disables this standard keyboard character. I might have thought a 2 character trigger like "\[" - eg "\[codes]" - would have been more appropriate maybe?

Anyway, I'm looking for a global setting like "EMBEDDED_FLAGS_OFF" or "EMBEDDED_FLAGS_ON" to ensure correct output - and given that it is recommended NOT to use embedded flags anyway, OFF should perhaps be the default.

Thanks.
Brent Rose
 
Posts: 50
Joined: Wed Mar 21, 2012 8:13 pm

Re: Avoiding Embedded Flag conflicts

Postby IDEAL Software Support » Tue Jul 24, 2012 9:27 am

The fact that VPE is having to parse every single output string for this reason is bad enough...


Checking for a flag, whether the parser is active or not, requires as much "performance" as checking the first character of the output string for a "[".

Workaround: Since there are only four text output methods affected by the parser (Print, PrintBox, Write, WriteBox), you can re-implement the four methods (naming them e.g. MyPrint, MyPrintBox, MyWrite, MyWriteBox) so you can insert a "[" in front of the passed strings in case there is already one existing. In case you are using the rendering functions, you need to re-implement them also (RenderPrint, RenderPrintBox, RenderWrite, RenderWriteBox).

We agree that this is sub-optimal, so we are considering to implement such a flag for convenience, but we have not made a decision yet - especially because you are the only customer asking for such a feature. In addition many customers - and therefore huge amounts of source code - rely on this feature, so de-activating it by default wouldn't be an option.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: Avoiding Embedded Flag conflicts

Postby Brent Rose » Tue Jul 24, 2012 8:29 pm

Thanks. A simple flag to turn embedded flag parsing OFF gets my vote, even if its a very lonely vote :wink:
Brent Rose
 
Posts: 50
Joined: Wed Mar 21, 2012 8:13 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 8 guests

cron