QMReplace()

QMReplace()

Top  Previous  Next

 

The QMReplace() function replaces the content of a field, value or subvalue in a dynamic array. It is analogous to the QMBasic REPLACE() function.

 

The function arguments are:

 

Srcis the dynamic array to be processed

 

Fnois the number of the field to be replaced. If zero, 1 is assumed. If negative, a new field is appended to the dynamic array.

 

Vnois the number of the value to be replaced. If zero, the entire field is inserted. If negative, a new value is appended to the specified field.

 

Svnois the number of the subvalue to be replaced. If zero, the entire value is inserted. If negative, a new subvalue is appended to the specified value.

 

NewDatais the new data to form the new dynamic array element.

 

 

The QMReplace() function returns a new dynamic array with the specified field, value or subvalue replaced.

 

This function is evaluated on the client system and does not require a server connection to be open.

 

The example program fragments below read a record with an update lock, use QMReplace() to modify it and then write it back to the file. A real program should test the error status from the read operations to determine if they were successful.

 

 

hmtoggle_plus1C

 

hmtoggle_plus1VB.Net

 

hmtoggle_plus1QMBasic Class Module

 

hmtoggle_plus1Java

 

hmtoggle_plus1Python