Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Autotext and VS macros?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
FlintZA Posted - Oct 03 2007 : 05:32:24 AM
Is there any way to utilise Visual Studio macros within autotext code?
Specifically, I am trying to automatically generate text which includes the project name and the VS $(ProjectName) macro would do the trick.
Alternatively, is there another way to access the project name?
10   L A T E S T    R E P L I E S    (Newest First)
FlintZA Posted - Oct 05 2007 : 02:42:09 AM
quote:
but co-workers didn't like it so I had to remove the GUID

That's one of the reasons I'm not too keen on it, I can just see the arguments I'll end up having about it :)
sean Posted - Oct 04 2007 : 2:17:16 PM
A request for GUID_STRING_ALT (any better name)?
mwb1100 Posted - Oct 04 2007 : 12:00:02 PM
quote:
Originally posted by FlintZA

Thanks for the suggestions.
I do already use the FILE_BASE keyword just without the prefix. I'll consider the guid and prompt options.



I used to use a guard something like $FILE_BASE_UPPER$_$FILE_EXT_UPPER$_$GUID_STRING$, but co-workers didn't like it so I had to remove the GUID portion. Now I can point them here and show that the GUID solves a real problem, not just an imaginary one.

Note that GUID_STRING doesn't exactly work because of embedded '-' character, but the snippet gives the idea.
FlintZA Posted - Oct 04 2007 : 02:24:58 AM
Thanks for the suggestions.
I do already use the FILE_BASE keyword just without the prefix. I'll consider the guid and prompt options. It's a real pity about not using the VS macros.. feature request forums here I come :)
sean Posted - Oct 03 2007 : 3:16:20 PM
To answer the original question, no you can not use Visual Studio macros within autotext code. The list of reserved strings is available at: http://www.wholetomato.com/products/features/autotext.asp
sean Posted - Oct 03 2007 : 3:07:26 PM
You could do something like this to get the filename from VA - then you can enter a custom prefix (or not):

#ifndef $prefix$$FILE_BASE$_h__
#define $prefix$$FILE_BASE$_h__

$selected$

#endif // $prefix$$FILE_BASE$_h__
hotzenplotz Posted - Oct 03 2007 : 2:16:56 PM
Well, I just used a custom "VAX macro" in the autotext entry, that way VAX asks me what to put there when I use the autotext.
Like this:
#ifndef INCLUDED_$INCLUDE_GUARD_NAME$
...

It would be more comfortable if VAX could put something meaningful there itself, but since I have very specific wishes about what $INCLUDE_GUARD_NAME$ should be, this is probably the best way for me.
bugfix Posted - Oct 03 2007 : 12:27:56 PM
guess you have to stick w/ smth like __$GUID_STRING$_$FILE_BASE$_h__ or write some VS macro to do the job.
FlintZA Posted - Oct 03 2007 : 09:10:09 AM
I suppose a better description may have helped :)
We use an autotext script that generates our comment block and header guard for .h files based on the filename.
I have run into a situation where two headers in different libraries have the same name (valid in this case) and while I can differentiate the header files themselves due to their location the guards end up being the same so only the first file's content gets handled:

/Core/PlatformSpecifics.h:

/* File header comment */
#ifndef _PlatformSpecifics_h__
#define _PlatformSpecifics_h__

namespace core 
{
// Code
}

#endif // _PlatformSpecifics_h__


/UserInterface/PlatformSpecifics.h:

/* File header comment */
#ifndef _PlatformSpecifics_h__
#define _PlatformSpecifics_h__

namespace userinterface
{
// Code
}

#endif // _PlatformSpecifics_h__


In another file:

#include <Core/PlatformSpecifics.h> // Ok, everything gets included
#include <UserInterface/PlatformSpecifics.h> // Broken, guards prevent anything from being included


I want to prefix the project/library name to the file name in guards to prevent this in future. I can obviously do it manually in the couple of cases it may arise, but I'd prefer save myself the pain of tracking down a silly mistake like same-name headers while in deadline groggyness :)

Unfortunately the above solution doesn't quite work in this case. I considered using a GUID macro, but that seems a bit dirty to me.
bugfix Posted - Oct 03 2007 : 08:54:56 AM
depending what you're trying to do a way might be to use projects' preprocessor settings. like _PROJECTNAME=$(ProjectName)

-bugfix

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000