Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table definition for CREATE CURSOR
Message
From
23/09/2005 12:49:39
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01052394
Message ID:
01052450
Views:
6
Are those kind of function (yours and Dan's) necesary? The AFIELDS() is enougth to create the cursor, so I'm meaning there's no need to create a loop in the ARRAY list created by AFIELDS since the CREATE CURSOR has a FROM ARRAY clause.
*  Program...........: CopyToCursor
*  Author............: Esparta Palma
*  Created...........: 09.23.2005  11:28 AM
*  Copyright.........: (c) Freeware
*) Description.......: Create a cursor bases on any table (or cursor) or
*)                   : actual area if not used second parameter into the 
*)                   : desired cursor.
*  Calling Samples...: m.TotalFields = CopyToCursor("cCustomer","Customer")
*)                   : m.TotalFields = CopyToCursor("cCustomer")
*  Parameter List....: tcCursor -> The name of the cursor to create
*)                   : tcAlias  -> The source alias
*  Returns...........: Any positive number if sucefull (the numbers of 
*)                   : created fields in the cursor)
*)                   : Any negative number if error (the Error number)     
*  Major change list.:
*--------------------------------------------------------------------------------------------------
FUNCTION CopyToCursor
LPARAMETERS tcCursor,tcAlias

   LOCAL nRetValue 

   IF (VARTYPE(m.tcAlias) # 'C') OR (EMPTY(m.tcAlias))
     m.tcAlias = ALIAS()
   ENDIF

   TRY
     m.nRetValue = AFIELDS(laFields,m.tcAlias)
     CREATE CURSOR (tcCursor) FROM ARRAY laFields
   CATCH TO oError
     m.nRetValue = oError.ErrorNo * -1
   ENDTRY

   RETURN m.nRetValue
ENDFUNC
HTH.
>>Brenda,
>>
>>Take a look at MESSAGE# 1004694
>>
>>Hope this helps
>>
>>-Dan

>Now I see I re-invented the wheel <g> It was not that hard, though <g>
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform