Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 small code template error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

makeshiftwings
New Member

8 Posts

Posted - Mar 17 2004 :  11:03:50 PM  Show Profile
This is a very minor bug, but in earlier versions of Visual Assist, you could include extended ASCII characters in code templates, such as -? . But in Visual Assist X, any extended characters in a code template disappear when it's inserted into a file.

makeshiftwings
New Member

8 Posts

Posted - Mar 17 2004 :  11:05:43 PM  Show Profile
Also, I should add I'm using the 10.0.1221.0 in Visual Studio .NET 2003, in C++ files.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Mar 17 2004 :  11:16:16 PM  Show Profile
But, those extended characters are illegal in C or C++ source code.

I realize that some compilers allow it, but...

Joe Pizzi
Go to Top of Page

makeshiftwings
New Member

8 Posts

Posted - Mar 17 2004 :  11:35:36 PM  Show Profile
Well, I only use them in comments... actually, the only one i use is the -? for a copyright which goes in a template header at the top of all our files. I *think* it's legal in all compilers to put them in comments, as comments aren't parsed so anything legal for a standard ASCII text file can go in there.
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 18 2004 :  02:31:44 AM  Show Profile
...while we're already at it:
Auto-Code Template-Suggestion Popup ALWAYS offers two identical entries...
For Example:
When I type "if", the popup shows two identical "if(-?) { }" entries to chosse from.
I think it should just offer one (since both entries are exact the same, couldn't find any differences between them).

Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 18 2004 :  05:17:00 AM  Show Profile
jpizzi: Why do you think those characters are not allowed? I've got the 1990 C spec in front of me. It says:
quote:
Section 5.2.1. If any other characters [*] are encountered in a source file (except in a character constant, a string literal, a header name, a comment, or a preprocessing token that is never converted to a token), the behavior is undefined.

[*] Other than the 92(?) characters required in the source character set, that is.
(Emphasis mine). It also says
quote:
Section 5.2.1.2: The source character set may contain multibyte characters, used to represent members of the extended character set.
Or am I missing something?

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Mar 18 2004 :  08:58:46 AM  Show Profile
Wannabee: Can you look for differences in your Autotext file?

Whole Tomato Software, Inc.
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 18 2004 :  09:11:40 AM  Show Profile
I will when I'm back home...

Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 18 2004 :  12:13:54 PM  Show Profile
Here you are, found the "bug"

First, this is the suggestion from VA_X:


Now, here you have an excerpt from my Cpp.tpl:

if:
if (-?) {
}
if:
if (-?)
{
}

while:
while (-?) {
}
while:
while (-?)
{
}

for:
for (-?) {
}
for:
for (-?)
{
}


I must confess, I did edit the Cpp.tpl a loooong time ago (in Build 1216 or somewhere around there).
I thought VA-X Setup would "detect" my changes and not add those Entries I edited (since it is just one of your "standard" entries slightly edited to my coding-style) again...

But, somehow, it must have entered them, which is not good and results in the shown behaviour...

Any chance for a fix? Or is this just the effect of an outdated Build (with which I edited the TPL) not noticed or found mention-worthy before?

What shall I do to test if this behaviour (adding templates although they are already present in TPL-File but slightly different from "standard" entries) is still there in the newer Setups?


Edited by - WannabeeDeveloper on Mar 18 2004 12:35:41 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Mar 18 2004 :  12:20:18 PM  Show Profile
personally i have started deleting "standard" entries from my current Cpp.tpl file that i dont use. since VAX keeps its list in the latest subdirectory i can always diff the two files and retrieve any i want back at a later date :)

zen is the art of being at one with the two'ness
Go to Top of Page

makeshiftwings
New Member

8 Posts

Posted - Mar 18 2004 :  5:04:23 PM  Show Profile
quote:

Section 5.2.1. If any other characters [*] are encountered in a source file (except in a character constant, a string literal, a header name, a comment, or a preprocessing token that is never converted to a token), the behavior is undefined.

[*] Other than the 92(?) characters required in the source character set, that is.


That's true, I forgot you can use them in strings too. As of yet, I haven't had to write a VAX code template that has extended ASCII in a string, but it's not inconceivable, so it would be a good bug to look at.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Mar 18 2004 :  11:39:48 PM  Show Profile
OK. I looked in the C++ standard (14882:1998). It is not nearly as explicit as the C standard (which you quote from), but does contain provision for "universal characters."

In fact, C++ even allows what I refer to as "accented characters" in identifiers.

Learn something new every day...

Joe Pizzi
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 19 2004 :  1:13:33 PM  Show Profile
Funny thing:
I just took a look at the "CS.TPL" (that's the one for C#, right?)

I never edited that one, cause I don't code in C#, but also there are duplicate entries!
In my "CPP.TPL", I thought it was my fault (cause I edited it manually), but I really never ever edited the C#-Templatefile!


if:
if (-?) {
}
if:
if (-?)
{
}
while:
while (-?) {
}
while:
while (-?)
{
}
for:
for (-?) {
}
for:
for (-?)
{
}

Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 19 2004 :  1:21:43 PM  Show Profile
They're not duplicates, they have the opening brace in different places, so that you can choose between two common coding styles.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Mar 19 2004 :  3:21:07 PM  Show Profile
Stephen is correct. Templates are different.

Line breaks in templates should appear as funny boxes in suggestion listboxes. Obviously, they do not for Wannabee. Listboxes for us look like this:


We are trying to track down the font used in our suggestion listboxes for Autotext. We get it from the IDE but we cannot yet determine from where the IDE gets it. We are still working on this and plan to have it resolved in build 1222. When done, either we or Wannabee changes the default font.

We tried using \\n for line breaks in listboxes. Ugly. We tried | but no go -- made one think of a caret position.

Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000