Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: jomeggs on April 14, 2008, 12:05:54 am

Title: Scripting: How to deal with GetDependenciesForProject()?
Post by: jomeggs on April 14, 2008, 12:05:54 am
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... 
   }

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


Your wiki says, the function is exported like:

Code
ProjectsArray* GetDependenciesForProject(cbProject* base)

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

Title: Re: Scripting: How to deal with GetDependenciesForProject()?
Post by: mandrav on April 14, 2008, 12:08:52 pm
Quote
So, 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.
Title: Re: Scripting: How to deal with GetDependenciesForProject()?
Post by: jomeggs on April 14, 2008, 02:08:52 pm
Please post this to the bug tracker so it's not forgotten.

Done, thanks for reply
Title: Re: Scripting: How to deal with GetDependenciesForProject()?
Post by: jomeggs on March 15, 2009, 02:21:31 pm
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();

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

Code
   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.