Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is shorter than Sys(2007) ?
Message
From
28/05/2008 09:39:18
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01319700
Message ID:
01319933
Views:
14
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform