# calculate a reference key with parameters of 0-99 (100 entries max)

Hi,

I am needing some advice on how to calculate a reference key.  The function I have is
int getReferenceKey(int key)
the value of the key is calculated by the formula
key=(location index)*10+(type index.)

thanks.

Kaz
###### Who is Participating?

Commented:
So just make some formula up and get a value from that.  You are already doing something like this according to your first post; simply chose another formula that generates a unique value.

If you have 100 entries, numbered 1-100 or 0 - 99, and six columns, numbered 1 - 6 or 0 -5, then a reference key could be entry * column with a little more 'spice' added to it.  Alternatively you could always use the address of each entry, that is guaranteed to be unique.

HTH
0

Commented:
Kaz

Can you clarify exactly what you are after please as it is not quite clear.

Cheers
0

Author Commented:
The program I am constructing will have up to 100 entries, consisting of say 6 columns of information.  Each line of each entry needs to have a reference key assigned to it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.