Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display Memory
Message
De
15/12/2003 15:20:30
 
 
À
15/12/2003 10:01:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00858707
Message ID:
00859257
Vues:
22
Thanks for the code!

>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
>
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform