Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find & replace 1

Status
Not open for further replies.

Winan

IS-IT--Management
Jan 1, 2002
83
ID
Dear All,

I need to find and replace all chr(10) with "" in a text file, how to do this with VB6?

many thanks in advance

Regards
Winanjaya
 
>VBBubbleRT6

And here I was thinking this was for VB tooltips ...
And I still do ...
 
Yes, look at how tooltips are implemented in C# forms for example.

I've been assuming that VB6 tooltips are done the same way, with the plumbing (and extra control) hidden as part of the form container.

In MakeItSo's sample code I'd be more likely to suggest the intrinsic constant [tt]vbLf[/tt] instead of [tt]Chr()[/tt] with a magic number (see "Magic numbers in code" at the link "Magic number (programming)" which can't be linked directly here due to TGML limitations).
 
Winan, try this:

I tested with 15mb text file.


Code:
Private Sub Command1_Click()
    Dim TextFileDir As String
    Dim TempFileString
    
    TextFileDir = "C:\TEST.txt"
    
    'Read file contents to string
    Open TextFileDir For Input As #1
        TempFileString = Input(LOF(1), 1)
    Close #1
    
    'Replace chr(10) with ""
    'No Looping is required because the replace
    'function makes all possible replacements
    TempFileString = Replace(TempFileString,Chr(10), "", 1, , vbTextCompare)
    
    'Re-Write File with changes
    Open TextFileDir For Output As #1
        Print #1, TempFileString
    Close #1
End Sub
[\code]
 
>And here I was thinking this was for VB tooltips ...

I just confirmed that the classname for a VB tooltip window is VBBubbleRT6 in a compiled EXE and VBBubble when running in IDE.

And I now assume the information presented in the article I read was plainly false.

I also verified that all VB control classes point to the same window procedure, and this is the same window procedure actually used by all VB controls.

It proves that these controls are not further subclassed after creation. Messages for all controls and forms in the application are sent to a single window procedure which acts like a message control center.

I am still not clear how does this central window procedure identify different controls and routes the messages belonging to different windows to their respective window procedures?
 
I will see it further. Thanks for the information. A star for you.

I know I can count on you when Google has nothing to say about.
 
> Eh? Doesn't this work?

Yep, sure does. I should of thought about manually URL-encoding it myself (doh!).
 
strongm, thanks for sharing that link. I believe I see now why I've been confused by this terminology. It appears that superclasses are a defined class inheriting from a base class, and are called superclasses because they provide a superset of the functionality of the base class from which they inherit.

In the semantics with which I'm familiar (the OMG UML spec, in particular), base class and superclass are synonymous terms. A superclass is called such because it is higher up in the inheritance tree than a subclass inheriting from it. So, a superclass in API terminology fits the description of subclass in OMG terminology, since it inherits from a base class and specializes the behavior of the class.

Is there some great semantic schism, conflict, rift that needs to be understood here?

Bob
 
Just Microsoft doing their normal thing of slightly redefining terms to suit themselves...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top