Puzzled with Mac Address

Hi… I’m setting the mac address in a global variable and then setting the value as an auto enter in a text field when I create a new record.

The data that shows up is this:

[Ljava.lang.Object;@8c9a7e

What happened? Gremlins? Aliens? Bad newbie programmer?

Chico

What you see is a pointer (memory address) to a Java object. That Mac address you stored was obviously not a string or not stored AS a string.
Where did you get that Mac address ? And what type is this global (media perhaps ?)

Hope this helps.

I think he uses the free tools plugin of IT2BE.
that tool returns the mac-addresses of your computer in an array.

so if you want to store them as text you need to do this.

this is the sample code of Marcel:

var addresses = plugins.it2be_tools.client().MACAddress;
if (addresses) {
	for (var i = 0 ; i < addresses.length ; i++) {
		message += "MAC address " + (i + 1) + ":\t\t" + addresses[i] + "\n";
	}
} else {
	message += "MAC address(es):\t\tnot available" + "\n";
}

or

var addresses = plugins.it2be_tools.client().MACAddress;
yourcolumn = addresses.join(',') //will create a string of the array, with comma as seperator

That did it. High fives are errupting in the office here!

Servoy Forumers are a speedy crew!

-chico

Thank you for replying for me Harjo :)

Chico, (almost) all plugins come with tooltips and sample code.

The tooltips appear in the status bar.
The sample code can be pushed from the Outline in the method editor.