Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Scripting: How to deal with GetDependenciesForProject()?

(1/1)

jomeggs:
Could somebody please tell me, how to deal with the GetDependenciesForProject() function and it's results in CB scripts?

I tried:


--- Code: ---local asProjects = GetProjectManager().GetDependenciesForProject(oPrj);

foreach(prj in asProjects)
   {
   ...do something with prj... 
   }

--- End code ---

As result I got an errormessage and some debug informations in Script console:


--- Code: ---AN ERROR HAS OCCURED [cannot iterate userdata]

CALLSTACK
*FUNCTION [GenerateDocumentsWithDependants()] C:\...blah.script line [378]
*FUNCTION [OnMenuClicked()] C:\...blah.script line [116]

LOCALS
[@ITERATOR@] NULL
[prj] NULL
[@INDEX@] NULL
[asProjects] USERPOINTER
[oPrj] INSTANCE
[this] INSTANCE
[index] 1
[this] INSTANCE

--- End code ---


Your wiki says, the function is exported like:


--- Code: ---ProjectsArray* GetDependenciesForProject(cbProject* base)

--- End code ---

So, isn't that a standard squirrel array type?

mandrav:

--- Quote ---So, isn't that a standard squirrel array type?
--- End quote ---

No and actually you can't use the returned type, only as an argument to another function. Such a function does not exist however so this is practically unusable.

Please post this to the bug tracker so it's not forgotten.

jomeggs:

--- Quote from: mandrav on April 14, 2008, 12:08:52 pm ---Please post this to the bug tracker so it's not forgotten.

--- End quote ---

Done, thanks for reply

jomeggs:
Regarding Bug #13608:
It's still the same, tried it today.

I found another issue regarding global constants. When I tried do execute:


--- Code: ---   if( PLATFORM == PLATFORM_MSW )
      do_something();

--- End code ---

I've got a squirrel error. It worked fine when I prefixed "::" to the constant:


--- Code: ---   if( ::PLATFORM == ::PLATFORM_MSW )
      do_something();

--- End code ---

 It's not a bug, but not mentioned in documentation. This problem occurs while using constants inside a function.

Navigation

[0] Message Index

Go to full version