VBScript Issue

Software technical issues not related to any of the other categories

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
bushell85
Enthusiast
Posts: 9
Joined: Mon Apr 28, 2014 5:12 pm

VBScript Issue

Post by bushell85 » Mon Dec 08, 2014 3:42 pm

Hello,

I have created a simple labelling system that is connected to a SQL datasource via ODBC.

It works fine.

I wanted to be able to hide text on label in a variable when another variable has no data in it.

I.e if Variable1 is Null then Text1 is visible else Text1 is not visible.

Done something similar to the code below

Code: Select all

Dim a
if ProductID="ProductB" then
  a = label.SetObjectVisible("ColorCode",False)
else
  a = label.SetObjectVisible("ColorCode",True)
end if 
It works fine but I am finding that when I run the code once, when I come to print the next label the variable is permanently set to "not printable" status.

Is there anything I can do to make the object return to a printable state once the code tells it not to be printable?

This is my code so far..

Code: Select all

Dim a
Dim b
b = [LabelData.idc]
If IsNull(b) Then
a = label.SetObjectVisible("Text1",True)
else
a = label.SetObjectVisible("Text1",False)
end if
Thanks for your time.

Dennis Ehmig
Addict
Addict
Posts: 157
Joined: Fri Mar 28, 2014 2:10 pm

Re: VBScript Issue

Post by Dennis Ehmig » Tue Dec 09, 2014 10:47 am

Hi,

I'm not sure why it would go into not printable status to be honest. But I would recommend to simply manipulate the variable that is used in the object you want to hide. Setting the variable of an object (text, graphic, etc) to an empty string makes the object basically invisible. This should get you the result you want.

Post Reply