Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table definition for CREATE CURSOR
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01052394
Message ID:
01052463
Vues:
9
The function was an Quick & Dirty program which I din't test (no VFP in this machine rigth now), the english grammar will be always a problem since it isn't my native language (and I don't use it frecuently to write it up ;-).

>By the way, don't put m in the left side of the expression and fix some grammar problems in your comments. Sorry for being picky <g>

>>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
>
>
>Hope this helps.
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform