News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Scripting: How to deal with GetDependenciesForProject()?

Started by jomeggs, April 14, 2008, 12:05:54 AM

Previous topic - Next topic

jomeggs

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

I tried:


local asProjects = GetProjectManager().GetDependenciesForProject(oPrj);

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


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


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



Your wiki says, the function is exported like:


ProjectsArray* GetDependenciesForProject(cbProject* base)


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


mandrav

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

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.
Be patient!
This bug will be fixed soon...

jomeggs


jomeggs

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

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


   if( PLATFORM == PLATFORM_MSW )
      do_something();


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


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


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