Page 1 of 1

What's wrong with this code?

Posted: Tue Mar 04, 2014 8:28 am
by shawnblc
Last night I had this code working, but today it isn't. Perhaps I changed something, but I'm not getting errors, but I'm not getting any results either.

Is there something wrong with this code? If so, any pointers?

Code: Select all

put line 1 of the hostNameToAddress of the hostName into the fld "fldIPAL"

Re: What's wrong with this code?

Posted: Tue Mar 04, 2014 10:49 am
by Simon
The problem isn't the obvious except for the misplaced something opposite to the indefinite article. I the think. :D

Klaus will know the the answer.

Simon

Re: What's wrong with this code?

Posted: Tue Mar 04, 2014 11:50 am
by Klaus
:D

Hi Shawn,

do not use THE when addressing Livecode objects!
THE is reserved for addressing custom properties, so leave out the THE and it will work,
as long as you really have a field named "fldIPAL". 8)
...
put line 1 of the hostNameToAddress of the hostName into fld "fldIPAL"
...
Tested and works :D

But maybe you want to use the "usual" FUNCTION syntax, which is better readable in my opinion:
...
put line 1 of hostNameToAddress(the hostName) into fld "fldIPAL"
...

Best

Klaus