Follow

Open a table and return a value

*/ Instantiate end set the database location.

oBiz = createobject("bizinfo.application")

oBiz.cDatabasePath = "C:\WinBIZ Data"

oBiz.nCompany = 1000

oBiz.nYear = 2017

EOL = chr(10) + chr(13)

*/ Open the Addresses table.

oBiz.cScript = oBiz.cScript + [ oSession.TableOpen("Adresses") ] + EOL

*/ Look for the value 000006 in the ad_code field.

oBiz.cScript = oBiz.cScript + [ locate for ad_code = "] + "000006" + ["] + EOL

oBiz.cScript = oBiz.cScript + [ if found() ] + EOL

*/ If the value has been found, return ad_numero.

oBiz.cScript = oBiz.cScript + [ return ad_numero ] + EOL

oBiz.cScript = oBiz.cScript + [ else ] + EOL

*/ Otherwise return -1.

oBiz.cScript = oBiz.cScript + [ return -1 ] + EOL

oBiz.cScript = oBiz.cScript + [ endif ] + EOL

*/ Execute the script. The returned value is the ad_numero for the article with ad_code = 000006. If the ad_code is not found, -1 is returned.

? oBiz.ScriptExecute()

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

Comments