Error: Vbscript "invalid Procedure Call Or Argument: 'mid' S’abonner

0
Avatar
Legacy Poster

Why does version 10 SR3 give this error with the VBscript below:

Value = Mid(Value, InStr(Value,"|"))
Value = Replace(Value, "|","")

The script works fine in old versions and version 10 but it show "Script Error"

5 commentaires

0
Avatar
Domingo Rodriguez
Modérateur
Actions pour les commentaires Permalien

Hello,

Could you also attach your BT document (.btw) to this topic?
0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

The script works fine for me in v10 SR3.

With a data source of: Sample|Text

And I place the VB script in the OnProcessData event under the data source's "Transforms" tab, then I get an end result value of: Text

Where is your VB script located?
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

[quote name='Ian C - Seagull Support' timestamp='1358347621' post='4090']
The script works fine for me in v10 SR3.

With a data source of: Sample|Text

And I place the VB script in the OnProcessData event under the data source's "Transforms" tab, then I get an end result value of: Text

Where is your VB script located?
[/quote]

Its located OnProcessData under the Transform tab. The script works when i print but when the label is open it shows "<script Error>"
0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

I guess the default value of the object when in design mode is not compatible with your script. Either give the object a default value which won't cause the script to error or surround the script with the following If..Then statement:

[code]
If Format.IsPrinting Or Format.IsPrintPreview Then

...

End If
[/code]
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

[quote name='Ian C - Seagull Support' timestamp='1359047012' post='4193']
I guess the default value of the object when in design mode is not compatible with your script. Either give the object a default value which won't cause the script to error or surround the script with the following If..Then statement:

[code]
If Format.IsPrinting Or Format.IsPrintPreview Then

...

End If
[/code]
[/quote]

Worked.

Vous devez vous connecter pour laisser un commentaire.