Follow

GetValue

This method returns the content of a field from a Table if a given value exists in a specified field.

Syntax:

oBiz.GetValue(<vValueToSearch>, <cFieldToSearch>, <cFieldToReturn>, cTableToSearch>)

 

Parameter

Description

vValueToSearch

Specifies the value to be searched for.

cFieldToSearch

Specifies the Field in which the value vValueToSearch has to be searched for.

cFieldToReturn

Specifies the field whose content has to be returned.

cTableToSearch

Specifies the table in which both the fields cFieldToSearch and cFieldToReturn are located.

Remarks:

The syntax of this method is the same as GetValueSQL.

 

The difference between these two methods consists in:

 

GetValue() is slightly faster than GetValueSQL() if cFieldToSearch and cFieldToReturn are both covered by indexes.

 

After using GetValue() the pointer will be on the record in which the result is found. If you are, as an example, performing a Table Scan on the same table from a script, the use of GetValue will move the pointer. This will break the continuity of the scan.

 

GetValueSQL() is faster than GetValue() if cFieldToSearch and cFieldToReturn are not both covered by indexes.

 

After using GetValueSQL() the pointer will not move from the record where it was located before using the method. If you are, as an example, performing a Table Scan on the same table from a script, the use of GetValueSQL will not move the pointer and will not break the continuity of the scan.

Example:

*/ Instantiate end set the database location.

oBiz = createobject("bizinfo.application")

oBiz.cDatabasePath = "C:\WinBIZ Data"

oBiz.nCompany = 1000

oBiz.nYear = 2017

*/ Display the 1st address line for an address whose Company Name is "Company Name".

messagebox(oBiz.GetValue("Company Name", "ad_societe", "ad_rue1", "adresses"))

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments