07-16-2014 07:47 AM
Hi,
I'm just trying to use the new create project dialog of LabVIEW2012, in order to use template projects.
I would like to use my templates from 2012 and the next versions, without having to change my code.
But it seems that between LabVIEW 2012 and 2013, there is a small difference when copying the project template :
- in LabVIEW2012: the project hierarchy is copied prefixed by the file prefix you entered,
- in LabVIEW2013: the project hierarchy is copied prefixed by the file prefix you entered AND an additionnal empty space
Is this a "normal" behavior or just a bug ? This empty space generated makes my projects non-functional...
Is there a way to bypass that ?
Thank you for your answers!
Solved! Go to Solution.
07-16-2014 08:07 AM
Could you show us a picture of what you mean? I can't visualize what you mean in my mind.
Thanks! 🙂
07-16-2014 08:21 AM - edited 07-16-2014 08:23 AM
Sorry if I wasn't clear...
- 1st enclosed image is my project template configuration dialog box : I want to add "TOTO" (no empty space) as a file prefix
- LV2012.png is my generated project in LV2012 : my VIs are prefixed with "TOTO" (no empty space)
- LV2013.png is my generated project in LV2013 : my VIs are prefixed with "TOTO " (with an empty space)
The problem is that in my template, I needed the file prefix of my project to get the path of an error file called TOTO_errors.txt that is additionnaly generated with a post action script. So in LabVIEW 2013, the file prefix I get is incorrect ("TOTO " - with an empty space) and then I cannot get the correct path to my error file.
I don't understand this difference between LabVIEW versions...
07-16-2014 10:28 AM
That is an unfortunately undocumented change
I have to admit I approve of the space (It centers the text of the banner in the icons that would otherwise get a "_")
Getting to "TOTO_errors.txt" from either version is only a trim whitespace away in your post action script and should maintain backward compatability.
07-16-2014 10:29 AM
We changed the prefixing in LabVIEW 2013 and later to add a space after the prefix. However, it does not add the space if you include an underscore in your prefix. Is your post copy scripting code adding the underscore to all generated items after the project is created?
07-16-2014 10:35 AM
Oh hey, guess what? I forgot that we added an INI token to disable the new behavior. If you add this token in LabVIEW 2013 or later:
NewProjectNoAddedSpaceOnPrefix=TRUE
Then you'll get the same 2012 behavior of no space being added to the prefix. If you want to see the code that handles all of this in LabVIEW 2013 and later, check out this VI:
resource\dialog\NewProjectWizard\Project Copying\Add Space to Prefix.vi
07-16-2014 10:37 AM
Thanks Darren !
No, my post copy scripting code is not adding any _, but all my VIs are prefixed with an _ (because the developer creating a new project will enter a prefix like TOTO, not TOTO_)
But If adding an _ to the prefix removes the empty space, then I'll document it so the developer enters a prefix with an _, and I'll remove all _ in my VIs
07-16-2014 10:42 AM
@MountainClimber wrote:
No, my post copy scripting code is not adding any _, but all my VIs are prefixed with an _ (because the developer creating a new project will enter a prefix like TOTO, not TOTO_)
But If adding an _ to the prefix removes the empty space, then I'll document it so the developer enters a prefix with an _, and I'll remove all _ in my VIs
That would work. Or you could have your developers use the INI token I just mentioned if you don't feel like going and editing all of your source.