Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Can't type "("

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
dgehri Posted - Sep 08 2006 : 07:44:43 AM
I'm using VA.X 1534 and I have a .h C++ file, in which VA.X prevents me from typing an opening bracket "(". I have to disable VA.X to get it to work...

Any ideas ?

- Daniel


#ifndef INCLUDED_420946040617_H
#define INCLUDED_420946040617_H

#ifdef _MSC_VER
#pragma once
#endif

#include <streambuf>

namespace lc {
namespace util {

class cntstreambuf : public std::streambuf
{
public:
    // constructor
    cntstreambuf(std::streambuf* sbuf) : 
        streamBuf_(sbuf), 
        lineNumber_(1),
        lastLineNumber_(1),
        column_(0),
        prevColumn_(static_cast<size_t>(-1)),
        filePos_(0) 
    {
    }

    // Get current line number
    size_t              lineno() const  { return lineNumber_; }

    // Get line number of last read character
    size_t              lastLineNumber() { return lastLineNumber_; }

    // Get current column
    size_t              colno() const   { return column_; }

    // Get file position
    size_t              filepos() const { return filePos_; }

protected:
    cntstreambuf(const cntstreambuf&);
    cntstreambuf& operator=(const cntstreambuf&);

    // extract next character from stream w/o advancing read pos
    std::streambuf::int_type underflow() 
    { 
        return streamBuf_->sgetc(); 
    }

    // extract next character from stream
    std::streambuf::int_type uflow()
    {
        int_type rc = streamBuf_->sbumpc();

        lastLineNumber_ = lineNumber_;
        if (traits_type::eq_int_type(rc, traits_type::to_int_type('\\n'))) 
        {
            ++lineNumber_;
            prevColumn_ = column_ + 1;
            column_ = static_cast<size_t>(-1);
        }

        ++column_;
        ++filePos_;
        return rc;
    }

    // put back last character
    std::streambuf::int_type pbackfail(std::streambuf::int_type c)
    {
        if (traits_type::eq_int_type(c, traits_type::to_int_type('\\n'))) 
        {
            --lineNumber_;
            lastLineNumber_ = lineNumber_;
            column_ = prevColumn_;
            prevColumn_ = 0;
        }

        --column_;
        --filePos_;

        if (c != traits_type::eof())
            return streamBuf_->sputbackc(traits_type::to_char_type(c));  
        else 
            return streamBuf_->sungetc();
    }

	// change position by offset, according to way and mode  
    virtual std::ios::pos_type seekoff(std::ios::off_type pos, 
                                  std::ios_base::seekdir dir, 
                                  std::ios_base::openmode mode)
    {
        if (dir == std::ios_base::beg && pos == static_cast<std::ios::off_type>(0))
        {
            lastLineNumber_ = 1;
            lineNumber_ = 1;
            column_ = 0;
            prevColumn_ = static_cast<size_t>(-1);
            filePos_ = 0;

            return streamBuf_->pubseekoff(pos, dir, mode);
        }
        else
            return std::streambuf::seekoff(pos, dir, mode);
    }

    // change to specified position, according to mode
    virtual std::ios::pos_type seekpos(std::ios::pos_type pos,
                                  std::ios_base::openmode mode)
    {	
        if (pos == static_cast<std::ios::pos_type>(0))
        {
            lastLineNumber_ = 1;
            lineNumber_ = 1;
            column_ = 0;
            prevColumn_ = static_cast<size_t>(-1);
            filePos_ = 0;

            return streamBuf_->pubseekpos(pos, mode);
        }
        else
            return std::streambuf::seekpos(pos, mode);
    }


private:
    std::streambuf*     streamBuf_;     // hosted streambuffer
    size_t              lineNumber_;    // current line number
    size_t              lastLineNumber_;// line number of last read character
    size_t              column_;        // current column
    size_t              prevColumn_;    // previous column
    size_t              filePos_;       // file position
};


} // namespace util
} // namespace lc
12   L A T E S T    R E P L I E S    (Newest First)
rhummer Posted - Oct 10 2006 : 7:58:22 PM
We have had the issue reported enough we have added a case for it.

case=2951
feline Posted - Oct 02 2006 : 5:24:50 PM
eco, which language, IDE and version of VA are you using?

i don't think this has ever happened to me, but i have seen it reported before.
are you shutting down or rebooting you workstation? or is it staying on all of the time?

do you have any idea why one day would be different to another?
eco Posted - Sep 21 2006 : 03:52:06 AM
Today, I got a new thing that is probably related to this pb.
'(' do not work... a yesterday morning, it's ok.
but today I see for the first time that Autotext is inserted in a bad file... the same file as '('.

If I close my file and reopen every thing is ok.
eco Posted - Sep 19 2006 : 08:43:17 AM
I saw this this morning again
It started just after I type '{' and immediatly a '('
(i know, this is stupid).
to correct the pb, I close my file, and reopen.
But I cannot reproduce it anymore :(
feline Posted - Sep 17 2006 : 12:13:26 PM
has anyone ever seen any sort of pattern to these problems?
anything that seems to trigger them happening?
jpizzi Posted - Sep 11 2006 : 11:14:09 PM
Your original post is still there:

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=5078
eco Posted - Sep 11 2006 : 09:43:51 AM
I've already post a topic on this bug, but it seem to have been deleted.
I've found that the parenthesis was inserted in another opened file...
close all files (not the project) and reopen it and I think it will be good for '('
grandchain Posted - Sep 11 2006 : 09:25:08 AM
I've seen this too. Not sure what caused it, but I found the text I had typed ended up in a different file window - the previous one I had been editing.

Cheers,

Ian
carnitron Posted - Sep 09 2006 : 5:59:18 PM
I have seen this frequently. The "(" is actually being received, it just ends up at some other point in the file, or up in one of the VAX combo boxes at the top. I think it may relate to the cursor location not being updated properly, but I'm not sure.

I also think it may be related to both the file and some "bad action" in that file. If you close all instances of the file and reopen it, the problem goes away, but not until then. I have theorized that is related to typing invalid syntax, but I have no evidence to support this theory yet.
support Posted - Sep 08 2006 : 8:47:11 PM
We suspect the problem might not be related to the file so you look for something common in what you did when the glitch occurs.
dgehri Posted - Sep 08 2006 : 3:12:11 PM
Yes, it is (was) specific to this file. But now, after restarting VS, it works fine again. I had the same problem in the past, using the same file. The code I posted is the complete content of the file, except the a missing copyright notice at the top.

- D
support Posted - Sep 08 2006 : 2:21:36 PM
We copy your sample code into VS2005 and can type ( as expected.

Is the problem specific only to this file? If so, can you zip and email it to us?

Is the problem specific to a location in the file?

Can you tell us what you type prior to the paren? Is there a listbox open at the time?

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