Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display Memory
Message
De
15/12/2003 10:01:21
 
 
À
14/12/2003 21:01:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00858707
Message ID:
00859097
Vues:
26
Here's what we do in an older program. Before the program gets to this point, the user inserts a floppy disk (1.44mb) and if it has any existing files on it, the user is prompted to erase all files on it. If the user does not, then he/she is prompted to insert another floppy disk before continuing and the same check is performed, etc. An array is created that contains all files that will be copied to floppy. It sums up the space required for each file and checks to make sure there is enough space on the floppy disk before copying. Typically our files are so small that they all fit on one floppy. However, for your purpose, you could do something similar but try different combinations of the files listed in the array to determine how best to spread them unto floppy disks. Of course if a file is too big, it won't be able to be copied regardless.
=ADIR(gaexpfiles,tdir+"*.csv")
=ASORT(gaexpfiles)
PRIVATE lntot, lctot
lctot=""
lntot=0
FOR i = 1 TO ALEN(gaexpfiles,1)
IF UPPER(TYPE('gaexpfiles(i,2)'))="N"
   lctot=lctot;
   +PADR(ALLTRIM(gaexpfiles(i,1)),25,'.');
   +PADL(ALLTRIM(STR(gaexpfiles(i,2))),25,'.');
   +CHR(13)
   lntot=lntot+gaexpfiles(i,2)
ENDIF
ENDFOR
lctot=lctot+'Total Free Space Required : '+ALLTRIM(STR(lntot))+CHR(13)
lctot=lctot+'Space on your Floppy Drive: '+'1384576'+CHR(13)+CHR(13)
PRIVATE tcfile
IF lntot>1384576	&& not enough space on floppy drive to copy files
   MESSAGEBOX(lctot;
   +'Not enough space on floppy disk to copy files.'+CHR(13);
   +'Click OK to Abort this Operation and Return'+CHR(13);
   ,16, 'ERROR - Insufficient space on floppy drive.')
   *do whatever you need to since you cannot copy to floppy
ELSE	&& ok to copy to floppy drive
   *Copy the file to the floppy
ENDIF
.·*´¨)
.·`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"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform