Bartender 10.1 Does Not Process Vb The Same As 9.4 追蹤

0
Avatar
Legacy Poster

*UPDATE*

 

Ugh, this is burning me badly. 75% of my labels have had to be retrofitted with the referencefield  :mellow:  Never caught it because the conditional value wasn't trapped in testing.

 

---

 

I upgraded a test server recently from 9.4 to 10.1. All went well. Did the same today. No problems, except then it turns out some of my labels won't print. This was a very nasty bug because it was super difficult to catch, but after several hours I did finally nail it down. Here it is. I have a field from a database file called PARENT. Based on its conditions I append a sub-value of CHILD. Remember, "value" here is Parent because I already set that up for the object:

 

Does not run and complaints of needing to add ReferenceField("Label.CHILD") at beginning of the script (after which it does run).

 

If IsNumeric(Value) Then
    If Value >= 7000000 And Value <= 9949999 Then
        Value = Value + Right(Field("Label.CHILD"),3)
    End If
End If
 
This does run
 
If IsNumeric(Value) Then
        Value = Value + Right(Field("Label.CHILD"),3)
End If
 
---------
 
It appears to me that double-nesting an if/then, but then this also doesn't run (complains of needing ReferenceField):
 
If IsNumeric(Value) And Value >= 7000000 And Value <= 9949999 Then
        Value = Value + Right(Field("Label.CHILD"),3)
End If
 
But this does run without referencefield:
 
If IsNumeric(Value) Then
    If Value >= 7000000 Then
        If Value <= 994999 Then
            Value = Value + Right(Field("Label.CHILD"),3)
        End If
    End If
End If
 
So I conclude that without referencefield VBscript in BT cannot tolerate two conditional ands for an if then, which is really surprising!
 
This never caused me a problem with 9.4 and I have to pre-pend my script with the ReferenceField, which means I'm changing labels that shouldn't need a change, and as we all know even a "cannot find printer anymore" on the system making a change can mess up formatting of a label.
 
We have a strict process for okaying changes to labels, but short of backing this out now to 9.4 I'm forced to basically wait until the label room identifies labels that won't work (this original script runs fine unless the parent value is in the numerical range) and then add the referencefield to the top.

1 意見

0
Avatar
Legacy Poster
評論操作 永久連結

Ran into this again today on a couple of labels that were previously working in 9.4 but now don't. They were failing because of "else if" in the script.

 

The really infuriating thing about this is that the error message from Bartender tells me precisely how to fix it (it knows what the error is exactly), yet is incapable of putting that in place real time when it executes the script--as it must be doing in 9.4 because this vbscript worked in 9.4 on all my labels, so 10.1 is clearly not backward compatible with 9.4 labels, a nasty lesson to learn post-launch even having tested a multitude of labels in test's 10.1. The esoteric nature of this bug was hard to catch.

登入寫評論。