Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is shorter than Sys(2007) ?
Message
De
28/05/2008 09:39:18
 
 
À
27/05/2008 11:53:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01319700
Message ID:
01319933
Vues:
15
>Hi All,
>
>The length of sys(2007) is 5 numbers. I'd like to convert this into a character string of alphabetic letters (A-Z), in order to get rid of some positions. I can write the algorithm, but perhaps someone else already wrote one?!

Why not simply use int(val(sys(2007,"whatever"))) ? Thats 4 Bytes.

And you could also generate the better CRC32.

Or do you want to make this part of a serial number so you can check it's valid? Transform it to letters so users will save typing some chars?

On a side note:
You surely also know sys(2017) - did you know you can influence it by SET FIELDS ?

As learned by Anders Altberg about two weeks ago:
CREATE CURSOR curCRC (cTest C(8))
INSERT INTO curCRC VALUES ("whatever")
? SYS(2017)
SET FIELDS TO cTest = UPPER(cTest)
? SYS(2017)
Making checks on the basis of checksums at least when usind Sys(2017) should take this into account.

Bye, Olaf.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform