Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RecordManager class
Message
From
07/08/2012 17:55:15
 
 
To
07/08/2012 09:13:16
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01550048
Message ID:
01550101
Views:
65
SELECT Field FROM Table INTO Cursor Test
IF _TALLY != 0

ENDIF
Is that really so difficult?

>Graig,
>
>>How will you deal with a set of records? Have you run timing tests to compare this to using cursors. BTW, I think cursors are a better way to go in VFP.
>
>Its a wrapper around a cursor. The main benefits are that you don't have to know the alias, don't have to think about error handling, restoring the current workarea etc. The alias is set once and forget about it. Just look at the implementation. Under the hood its just performing the same XBASE commands, so you can expect the same performance. An exception is the accessing (reading and writing of the fields err. data properties) which is about 100 times slower, but still in the order of 100.000 I/Os per second.In most implementations that is not a big deal. If you need to process a lot of records, you can still execute the XBASE or SQL commands directly on the cursor. There is no conflict.
>
>The main reason for me to develop this is to get away from writing the same code again and again... e.g.
>
>
>nSel = SELECT(0)
>TRY
>     SELECT (cAlias)
>     LOCATE FOR ....
>     lRet = FOUND()
>CATCH TO oErr
>    .....
>ENDTRY
>SELECT (nSel)
>RETURN lRet
>
>
>Instead now I can do a
>
>
IF oRm.Locate(cExpr)
>   ..... yadayadayda
>ENDIF
>
>IOW, forget about the alias, forget about restoring alias, forget about the hidden complexity
>
>Walter,
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform