Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hashing alphanumeric string...
Message
From
17/09/2003 10:02:21
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00829843
Message ID:
00829850
Views:
25
>I am looking for a way to convert alphanumeric string to a integer. This will be use to index a primary key on a table that have two character fields as unique ID.
>
>Ex: FldFloor = "001"
>    FldRoom  = "BT007"
>
>Any one done a function that converts the string "001BT007" into a integer?

A "hash" function usually can produce duplicates, and is therefore not appropriate for a PK.

Perhaps you could use a serial number as a PK, and store the FldRoom and FldFloor fields separately?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform