WRObject linked to a Variable

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
Mattia
Valued Contributor
Posts: 26
Joined: Wed Dec 02, 2009 11:51 am

WRObject linked to a Variable

Post by Mattia » Thu Mar 04, 2010 2:26 pm

Dear sir,
I'm using a iteration cicle to check what object is linked to a variable. I didn't found a WRObject method suitable for this purpose, and so I use a Try..Catch statement.
That's my code:

Code: Select all

For i As Integer = 1 To labelIntf.Objects.Count

	Dim niceObject As NiceLabel5WR.WRObject = labelIntf.Objects.Item(i)
	Dim variableName as String = ""
	
	Try
	  variableName = niceObject.Variable.Name
	Catch ex As Exception
	  variableName = ""
	End Try
	...
Next i
It works, but it's ugly 8-[ ... Is there a better way to check if a WRObject is linked to a variable ?

Thank you
Mattia

User avatar
jurk
Addict
Addict
Posts: 175
Joined: Wed Sep 27, 2006 1:10 pm
Location: Sencur, Slovenija
Contact:

Re: WRObject linked to a Variable

Post by jurk » Thu Mar 04, 2010 2:38 pm

hello,

try to check for Variable's value like so:

Code: Select all

if (niceObject.Variable = Nothing)
' there is no variable
else
' we have a variable
end if
NiceLabel Development

Mattia
Valued Contributor
Posts: 26
Joined: Wed Dec 02, 2009 11:51 am

Re: WRObject linked to a Variable

Post by Mattia » Thu Mar 04, 2010 3:10 pm

It doesn't work, unfortunately!
[-X
niceObject.Variable is never "nothing", even when the object isn't linked to any variable...

Miso
NiceLabel
NiceLabel
Posts: 332
Joined: Tue Oct 24, 2006 6:12 pm
Location: Kranj, Slovenia
Contact:

Re: WRObject linked to a Variable

Post by Miso » Mon Mar 08, 2010 2:10 pm

Hello Mattia,

You are correct. We found a bug in our .NET wrapper, which causes that the wrapper variable object is returned even if object in NiceLabel is not linked to variable.

Bug was already fixed and will be standardly available in the next release. If you would like to have immediate solution please send me a PM and I will provide you a beta build of the .NET wrapper.

Best Regards,
Miso

Post Reply