Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need algorithm for cleaning check numbers
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Need algorithm for cleaning check numbers
Divers
Thread ID:
00359011
Message ID:
00359011
Vues:
50
Hi All,

I need a quick and elegant (quick's better) to clean up a char field that must contain only numbers.

I have to process some tables that are downloaded from several check cashing stores. Check cashing employees are among the most creative types I've ever come accross.

The app they're using on their end allows them to enter anything in the check number field, so sometimes we end up with "0000243" or "0234r;23".

What I need to do is go through the table and spot anything that has leading zeros or characters as part of the string, so that the two samples above would become "243" and "23423", respectively.

I've created a few different algorithms, but would like to get some ideas from others.

So far the fastest I've found is to go through the whole table and check every record with:

if str( val( checknum)) <> checknum
*something's not kosher with this number
endif

If anyone has a more creative approach, please let me know...

Thanks!

Alex
Low-carb diet not working? Try the Low-food diet instead!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform