photools.com Community

IMatch Bug Reports and Feature Requests => Bug Reports => Solved Bug Reports (for next version) => Topic started by: sinus on June 11, 2019, 02:20:50 PM

Title: Variables-prefix and postfix works not more correct
Post by: sinus on June 11, 2019, 02:20:50 PM
Hi Mario

Is it possible, that prefix and postfix works not more, like they should?

From the help:
prefix:Text
postfix:Text   
This functions allows you to specify a text to prepend (prefix) or append (postfix) to the variable content. Both functions are only evaluated when the variable has content. This makes it possible to display text before and after the variable, but only if the variable is filled.

For example this variable (but also others):

{File.AT.Verrechnung.TOTAL|prefix:T } produces a "T", although the attributes is totally empty.
I have checked this also with VarToy, where I see the same effect.

Is this a glitch or do I something wrong?

Title: Re: Variables-prefix and postfix works not more correct
Post by: Mario on June 11, 2019, 02:27:11 PM
I don't recall a change. Not sure if the "only if there is no content" is really the desired behavior...

Title: Re: Variables-prefix and postfix works not more correct
Post by: sinus on June 11, 2019, 02:51:35 PM
I don't recall a change. Not sure if the "only if there is no content" is really the desired behavior...

For me yes.
It is like it is written in the IMatch-help and until now (I guess, the last version) it worked fine for me.
For me a very useful thing, this prefix and postfix.
Title: Re: Variables-prefix and postfix works not more correct
Post by: Mario on June 11, 2019, 03:08:43 PM
When did it stop working?
The last change with variables was a while ago...maybe a unexpected side-effect of some other change? Not sure.

I'll move this into bug reports, just to check.
Title: Re: Variables-prefix and postfix works not more correct
Post by: sinus on June 11, 2019, 04:12:34 PM
When did it stop working?
The last change with variables was a while ago...maybe a unexpected side-effect of some other change? Not sure.

I'll move this into bug reports, just to check.


Thanks for checking.
I am not sure, when it worked, I would say in the last version (2019.4.2) it worked, but maybe I overseen this and it is even once earlier.

Could it be in relation with "defaultex" Variable Function?
 
Title: Re: Variables-prefix and postfix works not more correct
Post by: Mario on June 11, 2019, 04:36:46 PM
I have checked the code backwards until March 2018 in my revision control system. There is no code which appends the prefix/postfix only if the value is non-empty...???
From the code, I would say the help is wrong. As far as I can see, this has never worked, the prefix / postfix was always appended, unconditionally. Very strange.

I could change that, but then I probably break things other users have written using variables with posfix/prefix.
Title: Re: Variables-prefix and postfix works not more correct
Post by: sinus on June 11, 2019, 04:55:00 PM
I have checked the code backwards until March 2018 in my revision control system. There is no code which appends the prefix/postfix only if the value is non-empty...???
From the code, I would say the help is wrong. As far as I can see, this has never worked, the prefix / postfix was always appended, unconditionally. Very strange.

I could change that, but then I probably break things other users have written using variables with posfix/prefix.

Mario,
it is of course your choice and decision.
But only to say, I am 100% sure, that this worked before an the help is absolutely correct.

I know that for sure, because I used this a lot in my File Layouts.
There can be a lot of fields, what you don't know, is there a value inside or not.

Uhhh,  :-\ just seen now, my Layouts inside "Design & Print" are also affected.
There are now a lot of pointless Characters like "KM" or "Total" or "Alter" for empty fields, where before was correct nothing.
Title: Re: Variables-prefix and postfix works not more correct
Post by: Mario on June 12, 2019, 12:07:56 PM
I have restored the original (as documented) behavior.
If users run into trouble because of this, let me know.
Title: Re: Variables-prefix and postfix works not more correct
Post by: sinus on June 12, 2019, 01:19:50 PM
I have restored the original (as documented) behavior.
If users run into trouble because of this, let me know.

Thanks really a lot!!!  :)
Title: Re: Variables-prefix and postfix works not more correct
Post by: sinus on June 18, 2019, 12:53:05 PM
I have restored the original (as documented) behavior.
If users run into trouble because of this, let me know.

Mario,
cool, thanks for that.
In the actual version (2019.6.2) this works again, like before.  :)