by Torrie Moore >> Fri, 14 Jan 2000 0:10:17 GMT
Hi
We have a defaults object that contains several object references for the status of a transaction. If I want to check if the status of a tracsaction is one of several statuses eg
foreach trans in allTrans do
...
if trans.myStatus = defaults.myDefaultStatus1
or trans.myStatus = defaults.myDefaultStatus2
or trans.myStatus = defaults.myDefaultStatus3 then
...
endif
...
endforeach
Is it more efficient to use the code above or the code below? The code below implies that the status objects are pulled accross to the client node. Does this also happen in the above example.
vars
status1, status2, status3 : Status;
begin
...
status1 := defaults.myDefaultStatus1
status2 := defaults.myDefaultStatus2
status3 := defaults.myDefaultStatus3
foreach trans in allTrans do
if trans.myStatus = status1
or trans.myStatus = status2
or trans.myStatus = status3 then
...
endif
...
endforeach
Torrie Moore
Concept Engineering Limited
email torrie@concept-eng.co.nz
phone +64 3 343 3362
fax +64 3 343 3364
Snail mail PO Box 514, Christchurch, New Zealand