forum-msg-id-124883-edit

Original date:2014-08-12 11:07:50 Edited by: Nevla Subject: Re: Couple of questions about sequences

DerekParnell said...
Nevla said...

2)... what's the best way to store, access and update named constants?

I'm assuming you are talking about having names for indexes that are used to reference elements in a sequence. The easiest way is to use the enum method.

-- Example 
enum  
    CustID, 
    FirstName, 
    FamilyName, 
    Address, 
    CurrentBalance 
     

In the example above, CustID is assign the value 1 (default for enums), and each subsequent name is given the value of one more than the previous name.

Actually I may have used the wrong word by saying "constant". What I meant was the case when named *variables* are used to reference the indexing of some data stored within a sequence whose structure is changing. Suppose the case where your data elements are initially assigned positions 1,2,3,4,5... within a sequence, but later on, because of the changes that take place within the sequence, their indexing position changes. So, in this case I would need to re-assign a new indexing value to each of the named variables, to reflect the new structure. Now, if the "coordinates" of the stored data within a sequence keep changing all the time, and there are several independent elements to keep track of, managing their referencing through named variables may become a challenge. My question was about the best way to maintain an auto-updating sort of lookup table via named variables, to reflect the changes that take place in the sequence structure.

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu