Utility Functions and C Language Reference > Virtual Table Server Functions (VTS) for C, C#, and Java > Virtual Table Server (VTS) Functions for Multiple Connections > Alphabetical Listing > vtc_update_message_ifequals

vtc_update_message_ifequals

Deprecated. Use lrvtc_update_message_ifequals. Replaces the data in a field if the current data equals a given value.

C Language

VTCERR2 vtc_update_message_ifequals ( PVCI2 pvci,  char *columnName, int rowIndex, char *newValue, char *ifEqualValue, unsigned short *outRc );

C# Language

bool vts_multi.update_message_ifequals ( int pvci,  string columnName, int rowIndex, string newValue, string ifEqualValue);

Java Language

int Vtc.update_message_ifequals (  long pvci,  string columnName, int rowIndex, string newValue, string ifEqualValue, OutIntParameter outRc);
Data Update Functions

Arguments

Name Comments
pvci The server connection handle.
columnName The column to write to.
rowIndex The number of the row. The first row has index 1.
newValue The value to set the field to.
ifEqualValue The value to compare the current value of the field to.
outRc The status of the operation: 1 - Pass or 0 - Fail

vtc_update_message_ifequals writes the value to the field specified with the column name and row index if the value of the field when vtc_update_message_ifequals is called is equal to the ifEqualValue. If the ifEqualValue and the field value match, the field value is overwritten.

Return Values

Returns zero on success or one of the Error Codes.

C# Language: Returns true on success.

Java Language:   Returns zero on success or one of the Error Codes.

Parameterization

All string input arguments can be passed using standard parameterization.

Example

int rowNumber, rc = 0;
unsigned short 	status;
   ...
rc = vtc_update_message_ifequals(pvci, "Col1",
         rowNumber,
         "coming soon...",
         "out of stock",
         &status);
if (status == 1) {
	// success: value changed to "coming soon..."
} else {
	// failure: value did not change.
}
	

C# Language Example

.Net Multiple Connection Example

Java Language Example

Java Multi-Connection Example