Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why one code works, while other doesn't?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Why one code works, while other doesn't?
Divers
Thread ID:
00466654
Message ID:
00466654
Vues:
44
Hi everyone,

I had this peice of code, working fine:
create cursor lcTempCursor ;
	(WorkField M)
append blank

for i=1 to lntxtfiles

	lcFileName=lcPath+laTxtFiles[i,1]
	lnFileSize=laTxtFiles[i,2] && File Size
	lcSendFileName = lcPath+lcCurState+'\'+left(laTxtFiles[i,1],4)+'.txt'
	wait window nowait 'Preparing file '+lcSendFileName
	if file(lcSendFileName)
		erase (lcSendFileName)
	endif

	if lnFileSize< 5000000 && Small files

		append memo WorkField from (lcFileName) overwrite
		if !empty(alltrim(WorkField))
			replace WorkField with strtran(WorkField,'"','')
			copy memo WorkField to (lcSendFileName)
		endif
I changed it to be (I commented maximum size just for now, because the previous size doesn't work):
	wait window nowait 'Preparing file '+lcSendFileName
	if file(lcSendFileName)
		erase (lcSendFileName)
	endif

	if lnFileSize< 5000000 && 16777184 && Relatively small files <16 MB
		lcString=filetostr(lcFileName)
		lcString=strtran(lcString,["],'') && Remove double quotes
		llReturn=strtofile(lcString, lcSendFileName)
The first code works. The last code doesn't for some reason. I thought, the last code is more efficient, that's why I changed this program. What could be wrong here?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform