Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crap code
Message
De
12/05/2021 21:21:33
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
12/05/2021 17:17:46
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01679827
Message ID:
01680347
Vues:
67
>>The GO TOP is stupid since the scan will start at the top.

Yep, just as SCAN will reselect the correct alias() without the developer having to do it explicitly before ENDSCAN. I've seen both of these redundant practices more than once...
		IF m.wScanForEndOfDay = 1
				REPLACE OutForEOD WITH 0 for OutForEOD<>0 in ScanGrL
			endif
			SCAN
				wMessBody = m.wMessBody + CHR(13) + ALLTRIM(STR(OrdNmb))
			ENDSCAN
			wnAnswer = MESSAGEBOX(m.wMessBody, 4 + 32 + 256, m.goApp.cCaption)
Makes sense to split out the replace, though fwiw you could probably leave out the "in ScanGrL" since it must be already selected.

Other issue would be that the original always replaces OutForEOD with 0 if m.wScanForEndOfDay = 1, which might intentionally affect (for example) a timestamp field or trigger, in which case your version might be better with replace all...

None of that is a snipe obviously. I think we were both there for the mdot flame wars when CamelCase was the answer and mdot was obsolete... till it wasn't. Every so often that happens again in one of these threads and I don't want to miss out!
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform