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

Squirrel script with error : UnixFilename()

(1/2) > >>

LETARTARE:
hello,
with r8466:
the execution of this script causes an error on the "UnixFilename ()":

--- Code: ---///-----------------------------------------------------------------------------
/// test_UnixFilename.script : LETARTARE 15-10-2012
///-----------------------------------------------------------------------------

function SetBuildOptions (base) {
}
///-----------------------------------------------------------------------------
function main() {
/// path file configuration
local Nameconf = _T("default.conf");
/// locate 'default.conf'
local pathconf = ::LocateDataFile(Nameconf, ::sdAllKnown);
/// results
::print (pathconf)
/// ===> Squirrel error from revision r8394  <===
::print (UnixFilename(pathconf))
}
///-----------------------------------------------------------------------------
///  Vista business Pack2 , Mingw32 with TDM-GCC 4.5.2,  wxWidgets unicode 2.8.12
///  C::B ...r8393, r8394...r8466
///-----------------------------------------------------------------------------

///-----------------------------------------------------------------------------
///  with <= r8393  : it's good

/// C:\Users\aaa\AppData\Roaming\CodeBlocks\default.conf
/// C:\Users\aaa\AppData\Roaming\CodeBlocks\default.conf
///-----------------------------------------------------------------------------
///  with >= r8394  : Squirrel error

///  Message :
///  AN ERROR HAS OCCURED [Incorrect function argument]
///  CALLSTACK
///  *FUNCTION [main()] test_UnixFilename.script line [17]
///  *FUNCTION [main()] ScriptConsole line [1]
///-----------------------------------------------------------------------------
--- End code ---
looking, I found that the error occurs since r8394.

I think MortenMacFly realized the r8394.

Can you help me?
cordially

Jenna:

--- Quote from: LETARTARE on October 21, 2012, 02:43:45 pm ---looking, I found that the error occurs since r8394.

--- End quote ---

Are you sure it occurs with r8394 ?
I don't see anything related to scripting in this revision.

LETARTARE:
yes
I tried with r8393 and I have no error.
In changing MortenMacFly, I did not find any relationship with UnixFilename ()!

MortenMacFly:
...try to replace:
::print (UnixFilename(pathconf))

...with:
::print (UnixFilename(pathconf,wxPATH_NATIVE))

Does it work now?

LETARTARE:
hello,
thank you.
I tried with r8394, r8466 and I have no error.

-> Include\global.h is written:
r8393 :

--- Code: ---extern DLLIMPORT wxString UnixFilename(const wxString& filename);
--- End code ---
r8394 ... r8466:

--- Code: ---extern DLLIMPORT wxString UnixFilename(const wxString& filename, wxPathFormat format = wxPATH_NATIVE);
--- End code ---

of course must specify the defaults in Squirrel !!

But why the change from r8394 ?

Thank you again.

Navigation

[0] Message Index

[#] Next page

Go to full version