#include "fivewin.ch"
function Main()
PRIVATE Salary := 30
USE CUSTOMER
subfunc()
return nil
//----------
function subfunc()
local salary := 10
? salary, field->salary, memvar->salary
return nil
PRIVATE cproduct
select sales
goto top
cproduct:=sales->name
select products
locate for products->&cproduct="smart"
local cproduct
select sales
goto top
cproduct:=sales->name
select products
locate for products->&(cproduct)="smart"
sales->( dbgotop() )
select products
locate for products->&(sales->name)="smart"
// or
locate for &(sales->name)="smart"
sum all temp1->&(calias) to ntotalias
#include "fivewin.ch"
function Main()
local cfield, nTotSal
DBCREATE( "TMP.DBF", {{ "FLD", "C", 10, 0 }}, NIL, .T., "TMP" )
APPEND BLANK
FIELD->FLD := "SALARY"
CLOSE DATA
USE TMP NEW
cField := TMP->FLD
USE CUSTOMER NEW
SUM ALL CUSTOMER->&( cField ) TO ntotsal
? ntotsal
return nil
"Alert 38836300.00"?
CLASS TCustomers from TDatabase
Method New()
ENDCLASS
Method New( lShared ) Class TCustomers
Default lShared:= .T.
::Super:New(,"cust",,lShared)
If ::Use()
::SetOrder("CUSTNO") // Primary key
::Gotop()
Endif
Return self
// Note that this assumes you have set your databases to automatically open thier indexes when you open a database.
oCustomer:= TCustomer():New()
msgInfo( oCustomer:name )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Natter, Rick Lipkin and 24 guests