Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_VFP.DataToClip(,,3) Question
Message
De
28/03/2006 18:38:13
 
 
À
25/03/2006 07:18:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
01107602
Message ID:
01108636
Vues:
14
Cetin,

Thanks for the tip. But, when I ran the code you provided, I still had some
fields that were padded with spaces on the right. However, after looking at
your code, it gave me some ideas and I wrote the following code which solved
my problem. Thanks again.

Robert
WAIT WINDOW "CUT & PASTE Excel Data Collection ... Please Wait" NOWAIT NOCLEAR

ln_FieldCnt 		= FCOUNT()
ln_FieldLength 		= 0
ln_MinDataLength 	= 0
ln_MaxForLoop 		= 0

FOR x = 1 TO ln_FieldCnt
   IF TYPE(FIELD(x)) = 'C'
      lc_FieldName = FIELD(x)
      ln_FieldLength = FSIZE(FIELD(x))
      ln_MinDataLength = LEN(FIELD(x))
      GO TOP
      SCAN
        IF LEN(ALLTRIM(&lc_FieldName)) < ln_MinDataLength
           ln_MinDataLength = LEN(ALLTRIM(&lc_FieldName))		
        ENDIF
      ENDSCAN
      IF (ln_FieldLength - ln_MinDataLength) > ln_MaxForLoop
	ln_MaxForLoop = ln_FieldLength - ln_MinDataLength
      ENDIF
    ENDIF
ENDFOR

GO TOP
_vfp.DataToClip(,,3)

ln_Progress = 1
ln_ProgressFactor = 100/ln_MaxForLoop

FOR x = 1 TO ln_MaxForLoop
  WAIT WINDOW "Collecting and Processing CUT & PASTE Excel Data ... (" +ALLTRIM(STR(ln_Progress))+"% Complete)" NOWAIT NOCLEAR
    _cliptext = STRTRAN(_cliptext," "+CHR(9),CHR(9))
    ln_Progress = ln_Progress + ln_ProgressFactor
ENDFOR
WAIT WINDOW "CUT & PASTE Excel Data Collection ... (100% Complete) - Press Any Key to Continue" NOWAIT
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform