Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table definition for CREATE CURSOR
Message
From
23/09/2005 14:31:24
 
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:
01052513
Views:
9
PLEASE don't start that m. conversation again!~ :o) *G*


>BTW, 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
>>
>>
>>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>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform