QMChange()

QMChange()

Top  Previous  Next

 

The QMChange() function replaces occurrences of one substring with another in a string. It is analogous to the QMBasic CHANGE() function.

 

The function arguments are:

 

Srcis the string to be processed.

 

OldStris the substring to be replaced.

 

NewStris the replacement substring.

 

Occurrencesis the number of occurrences of OldStr to be replaced. If omitted or specified as less than one, all occurrences are replaced. Note that the Visual Basic 2005 API passes this argument by reference.

 

Startis the occurrence number from one of the first occurrence of OldStr to be replaced. If omitted or less than one, replacement commences at the first occurrence of OldStr. Note that the Visual Basic 2005 API passes this argument by reference.

 

The QMChange() function returns a new string with the specified substrings replaced. This function is evaluated on the client system and does not require a server connection to be open.

 

One typical use of QMChange() is to replace mark characters with carriage return / line feed pairs when transferring data from a dynamic array to a multi-line text box.

 

The examples below change three uppercase letter "A" to lowercase "a" in the supplied string starting at the second occurrence, returning the result.

 

 

hmtoggle_plus1C

 

hmtoggle_plus1VB.Net

 

hmtoggle_plus1QMBasic Class Module

 

hmtoggle_plus1Java

 

hmtoggle_plus1Python