object attribute unknown

Hi!

I get a failure: "unknown object Attribute". I don't know where the mistake is because, I write in the right object. The object is a "global variable".

My code is in the attached file.

 

 


bandchef - Fri Nov 22 09:32:44 EST 2013

Re: object attribute unknown
SudarshanRao - Fri Nov 22 09:49:56 EST 2013

The error you state indicates incorrect attribute name being specified. Look at the line number specified in the error, verify the spelling of the attribute name used and compare it against the attribute name in the module.

Alternatively, you could improvise the script to check if the attribute exists before trying to access the attribute in the script using exists perm:

bool exists(attribute(string attributeName))

Re: object attribute unknown
GregM_dxler - Fri Nov 22 11:59:24 EST 2013

Hello,

There are a lot of object attributes used, so SudarshanRao is right, it would be quickest to compare line to the item.

I don't think the case makes a difference in the name.

The line number will also give you a clue as to which module the problem is in, your current one or the one the outlink goes to.

May be also that the target module didn't get opened (access?).

Seriously, do you have an object attribute called "c_This_is_a"?

Hope this helps,

Greg

Re: object attribute unknown
llandale - Tue Nov 26 09:11:38 EST 2013

did not read your code.  Be advised that every module has attribute "Prefix", but that it is defined for the module only and not for objects.  Therefore, this line of code should get "unknown object attribute" error:

  • string Pref = o."Prefix"

I suggest therefore that you are accessing some attribute that is not defined for Objects.  Consider the following:

AttrDef ad

string Name

bool ForMod, ForObj

for ad in (current Module) do

{  Name = ad.name

   ForMod = ad.module

   ForObj = ad.object

   print Name "\t" ForMod "\t" ForObj "\n"

}

Also, this:

string Name = "MyAttribute"

AttrDef ad = find(current Module, Name)

if (null ad) then no such attrobute\

elseif(! ad.object) then attr not for objects

else attr available to objects

-Louie

Re: object attribute unknown
llandale - Tue Nov 26 09:21:05 EST 2013

SudarshanRao - Fri Nov 22 09:49:56 EST 2013

The error you state indicates incorrect attribute name being specified. Look at the line number specified in the error, verify the spelling of the attribute name used and compare it against the attribute name in the module.

Alternatively, you could improvise the script to check if the attribute exists before trying to access the attribute in the script using exists perm:

bool exists(attribute(string attributeName))

Nit-picks.  Notice the "exists" command presumes the "current Module".  So if you use it then do this 1st:

  • current = m

Also, "exists" says if the attr exists, but not whether it applies to Objects or not.

-Louie

Re: object attribute unknown
llandale - Tue Nov 26 09:26:43 EST 2013

Attached find the Attribute screen shots, so you can see what I'm talking about.

 


Attachments

Attributes.doc