VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Find/Replace/Remove Function for long strings/text files

Paul Wilson  (1 Submission)   String Manipulation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

This Function Searches a user defined string for a user defined search criteria it will return the postion of matchs in an array also will replace or remove criteria from string

Inputs
'strData = Target String to search - This is required 'strValue = String to search for within strData - This is required 'strReplace = String to replace any matches found with - This is optional 'boolRemove = this is a switch to activate the remove feature - Optional 'boolReplace = this is a swith to activate the replace feature - Optional

Assumes
'This functions purpose is to search for a user defined string within another user defined string 'It provides the ability to remove or replace that string 'The function returns an array with the start position of each match found. This feature means that the programer 'using this function has the ability to easily and quickly recreate the powerful find and replace features found in 'products like MS Word 'By recieving matches in an array you can quickly create a find first find next type feature as well 'THIS VERSION IS CASE SENSITIVE coming soon is the option for a case sensetive or generic search

Returns
'arrPos = This is a return the position of each match in an array 'lngFoundCount = This returns the count of matches found 'The actual function is a long Data Type and returns an error value '0 = Search Completed No Results '1 = Search Completed Matches Found '2 = No Target String defined '3 = No Search String Defined '4 = No Replace String Defined when Replace is set to true '5 = Both Replace and Remove features have been set to true '6 = Unexpected Error

Rate Find/Replace/Remove Function for long strings/text files (2(2 Vote))
Find/Replace/Remove Function for long strings/text files.bas

Find/Replace/Remove Function for long strings/text files Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters