News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Variable expansion into script plugin

Started by LETARTARE, February 20, 2012, 02:43:08 PM

Previous topic - Next topic

LETARTARE

I use 'C::B r7809'
1- I load a workspace named 'Normal' which becomes the current workspace
    'Normal' is displayed in the tab Projects of the Management panel
2 - I load this script in the console to retrieve the name of the workspace
function nameWS() {
/// name  *.workspace
local nameWS = ReplaceMacros(_T("$(WORKSPACE_NAME)") ) + ::DOT_EXT_WORKSPACE;
local filenameWS = ReplaceMacros(_T("$(WORKSPACE_FILENAME)") );
::print(nameWS)
::print(filenameWS)
   }

3- I run the script by typing by hand: : 'nameWS()'
4- I get the following results:
QuoteNormal.workspace
default.workspace
according to http://wiki.codeblocks.org/index.php?title=Variable_expansion#Code::Blocks_workspace
I should have:
QuoteNormal.workspace
Normal.workspace
Is this correct or a mistake?
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

oBFusCATed

Works correctly here (debugger branch r7780, Cenos 5.6)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

LETARTARE

Thank you very much.
What configuration?
I don't know Cenos.
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

LETARTARE

I like to have the opinion of someone who uses Vista because it is several times that I see any problems using the plugin scripts.

@ oBfuscated
thank you, but I did not know too!
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Jenna

Is the name of the workspace-file really Normal.workspace ?
default.workspace is the default name a workspace is saved as, if you create a workspace, give it a name and say Save workspace, instead of Save workspace as ... .

LETARTARE

QuoteIs the name of the workspace-file really 'Normal.workspace' ?
yes it is.
I backed up the new workspace 'Normal.workspace' but actually looking in the area of data backup, he had saved 'default.workspace' ??

CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

MortenMacFly

Quote from: jens on February 20, 2012, 06:16:47 PM
Is the name of the workspace-file really Normal.workspace ?
Maybe its due to translation...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

LETARTARE

#8
No, I tried with 'foo.workspace' I have the result
Quotefoo.workspace
default.workspace

I said that I saved 'save workspace as foo.workspace' and that the modified file in the area data is called 'default.workspace' ???
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Jenna

To be absolutely sure:
You have used "File -> Save workspace as ..." and have saved is as "Normal.workspace", or did you rename the workspace in the project-manager ?

Renaming it there has nothing to do with the physical workspace file written on disk.
This file is always called default.workspace, unless you save the workspace with "File -> Save workspace as ..." .

By the way: it works fine here.
The saving and your script.

LETARTARE

Thank you for answering me.
1 - I renamed the workspace 'foo.workspace '
2 - I saved the workspace under 'foo.workspace', the file is saved 'foo.workspace', all right
3 - if I try to save again by 'Save workspace'  is saved 'default.workspace'
4 - if I recharge 'C::B', it starts with 'foo.workspace''

The explanation http://wiki.codeblocks.org/index.php?title=Variable_expansion#Code::Blocks_workspace
Quote$(WORKSPACE_FILENAME) : The filename of the current workspace project (.workspace).
seems so wrong

Therefore EVERY TIME I backup 'save as ...' ???
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'