Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to empty fields
Message
 
 
À
15/03/2006 11:02:31
Reza Meamar
Homa Programming Group
Shiraz, Iran
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 7 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01104528
Message ID:
01104533
Vues:
14
>Dear all,
>I have a Cursor with 10 record and 20 fields in each record.
>I want to empty these fields in all record in maximum speed.
>What is the best way to do this?
>Thanks for your guide

scatter memvar memo blank
replace field1 with m.field1, ... all

Here is how you get all fields in the clipboard, so you can paste them in your code:
********************************************************************
*  Description.......: FieldsToString - creates a string with fields in a table
*  Calling Samples...:
*  Parameter List....: tlAddTypes, tlAddAlias
*  Created by........: Nadya Nosonovsky 04/21/2005
*  Modified by.......: *-- CHANGE - NN - August 10, 2005 - 15:10:45
********************************************************************
FUNCTION FieldsToString
LPARAMETERS tlAddTypes, tlAddAlias

LOCAL lcStr, lnI, lnFields, laFields[1], lcType
lnFields = AFIELDS(laFields)
lcStr = ""

FOR lnI = 1 TO m.lnFields
	lcType = laFields[m.lnI,2]
	lcStr = m.lcStr + ", " + IIF(m.tlAddAlias,ALIAS() + ".", "") + ;
		LOWER(LEFT(laFields[m.lnI, 1],1)) + ;
		PROPER(SUBSTR(laFields[m.lnI, 1],2)) + ;
		IIF(m.tlAddTypes, " " + m.lcType + ;
		IIF(NOT INLIST(m.lcType, "D","T","I","G","M","Y"), "(" + TRANSFORM(laFields[m.lnI,3]) + ;
		IIF(laFields[m.lnI,4] > 0, ", " + TRANSFORM(laFields[m.lnI,4]),"") + ")",""),"")
NEXT
_CLIPTEXT = SUBSTR(m.lcStr, 3)
Open your table and type in command window FieldsToString(). Then you would have all your fields in the clipboard.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform