Author Topic: Variables-prefix and postfix works not more correct  (Read 363 times)

sinus

  • Global Moderator
  • *****
  • Posts: 3699
  • IMatch-User since 2001 (IMatch 3.6)
Variables-prefix and postfix works not more correct
« 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?

Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23003
Re: Variables-prefix and postfix works not more correct
« Reply #1 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...


sinus

  • Global Moderator
  • *****
  • Posts: 3699
  • IMatch-User since 2001 (IMatch 3.6)
Re: Variables-prefix and postfix works not more correct
« Reply #2 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.
Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23003
Re: Variables-prefix and postfix works not more correct
« Reply #3 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.

sinus

  • Global Moderator
  • *****
  • Posts: 3699
  • IMatch-User since 2001 (IMatch 3.6)
Re: Variables-prefix and postfix works not more correct
« Reply #4 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?
 
Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23003
Re: Variables-prefix and postfix works not more correct
« Reply #5 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.

sinus

  • Global Moderator
  • *****
  • Posts: 3699
  • IMatch-User since 2001 (IMatch 3.6)
Re: Variables-prefix and postfix works not more correct
« Reply #6 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.
Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23003
Re: Variables-prefix and postfix works not more correct
« Reply #7 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.

sinus

  • Global Moderator
  • *****
  • Posts: 3699
  • IMatch-User since 2001 (IMatch 3.6)
Re: Variables-prefix and postfix works not more correct
« Reply #8 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!!!  :)
Best wishes from Switzerland! :-)
Markus

sinus

  • Global Moderator
  • *****
  • Posts: 3699
  • IMatch-User since 2001 (IMatch 3.6)
Re: Variables-prefix and postfix works not more correct
« Reply #9 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.  :)
Best wishes from Switzerland! :-)
Markus