Posted 15 years ago by Leif Zars
Avatar
i have a VB 2003 file I want to add, remove and update cretin lines in the code. Much like MS Visual Basic does when you working with visible objects during design time.
#Region "Managed Variables"
    Friend Depth0 as GaryPoolsMain.ScriptToEst.MangVar
    Friend Depth1 as GaryPoolsMain.ScriptToEst.MangVar
    Friend Depth2 as GaryPoolsMain.ScriptToEst.MangVar
Private Sub InitializeVariables()
    Depth0 = New GaryPoolsMain.ScriptToEst.MangVar("Depth0", "Double", MyParent, True)
    Depth1 = New GaryPoolsMain.ScriptToEst.MangVar("Depth1", "Double", MyParent, True)
    Depth2 = New GaryPoolsMain.ScriptToEst.MangVar("Depth2", "Double", MyParent, True)
End Sub

#End Region
I want to be able to quickly find and change, add or remove these related lines. For instance just changing depth0 to depth-0 in the 3 locations it is found. I think there is a lot of parsing functions out there, I just don’t know where to start.

Also I would love strings like “5+5” to automatically be formatted to “5 + 5” how would I do that. Also Strings like “end sub” to be changed to “End Sub”.

Let me know

Thanks

Leif

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you are doing find/replace that should not affect the user interface selection then use the editor.Document.FindReplace object and its methods. To do find/replace that does update selection and is more for what a user would interface with, you would use the editor.Document.SelectedView.FindReplace object and its methods. Both give you a full find/replace object model even supporting regular expressions.

Expanding text strings would have to be done manually by a call to editor.Document.UndoableInsert and replace the "5+5" text with "5 + 5".

Look at the "Case Sensitivity and Auto-Correct" documentation topic for how to do case correction.


Actipro Software Support

The latest build of this product (v2020.1 build 0402) was released 30 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.