Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rewrite code
Message
De
17/08/2006 05:19:38
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Rewrite code
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01146284
Message ID:
01146284
Vues:
51
hi all,

is ther a nother way to abbreviate this code under,
i have 5 excel sheet as bis_seg_1,bis_seg_2,to bis_seg_5.
*1, i need to import it to dbf,

IMPORT from bis_seg_1 TYPE XLS
IMPORT from bis_seg_2 TYPE XLS
...

.
.IMPORT from bis_seg_5 TYPE XLS


*************************************
*2, delete repated record for all tables ,bis_seg_1 to bis_seg_5

use bis_seg_1 exclusive
index on nCli tag nCli
select sys(2015) as SortOrder,* from bis_seg_4 ;
 order by 1 descending ;
 into cursor crsTemp nofilter
select bis_seg_1
zap
select crsTemp
scan
 if !seek(nCli,'bis_seg_1','nCli')
   scatter memvar memo
   insert into bis_seg_1 from memvar
 endif
endscan
*********************************
*3, create dbf tables as same field name,table fbus1...to fbus5

CREATE TABLE fbus1 ( column1 c(6) nocp  ,telno C(9) nocp, attribut_1 C(11) nocp,cust_name C(104)nocp, category c(4) nocp,ncli n(15),ndos c(6) nocp,lgest c(28) nocp)
CLOSE all
USE bis_seg_1
total = "5000"
*total = (THISFORM.TEXT1.VALUE)
RAND(-1)
INDEX ON RAND() TO SYS(2023)+'\RANDOM'
*COPY TO \SELECTION NEXT &total
COPY TO fbus1 NEXT &total
SET INDEX TO 
ERASE SYS(2023)+'\RANDOM'
      CLEAR EVENTS
      
*****************************
*4, convert it to excel sheet again??fbus1,fbus2,fbus3,fbus4 and fbus5
USE fbus1
gcDelimName = ALIAS( ) + '.xls'
gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
IF EMPTY(gcDelimFile)  && Esc pressed
   CANCEL
ENDIF

COPY TO (gcDelimFile) XLs   && Create delimited file
thanks
Répondre
Fil
Voir

Click here to load this message in the networking platform