Author Topic: Scripting: How to deal with GetDependenciesForProject()?  (Read 5724 times)

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Scripting: How to deal with GetDependenciesForProject()?
« 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?


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Scripting: How to deal with GetDependenciesForProject()?
« Reply #1 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.
Be patient!
This bug will be fixed soon...

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: Scripting: How to deal with GetDependenciesForProject()?
« Reply #2 on: April 14, 2008, 02:08:52 pm »
Please post this to the bug tracker so it's not forgotten.

Done, thanks for reply

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: Scripting: How to deal with GetDependenciesForProject()?
« Reply #3 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.