Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where is a default Field value coming from.
Message
 
 
To
21/01/2003 16:17:20
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00743018
Message ID:
00744011
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
Steve,

>So, I can create a primary key on a table, then define a counter in my app
>registry with the same name as the table.

Actaully, you don't have to create the counter in the registry. CodeMine does this the first time you add a new record to that table.

>Codemine will then automatically fill in the value with the counter value.
>No other code or settings required.


Correct. It will actually do a search in the table to make sure it has the next available higher number in the the Primary index field, and store that in the registry. It will continue to increment this number it finds in the registry. To take it a step further, when you open the table and add a new record, it also goes to the last record in the table to make sure the registry has the true next available number - and if it doesn't it will correct that in the registry (it does this just on the first New record after the table is open). All frameworks don't do this double check when opening a table and adding a new record, but CodeMine does because of using the Primary index.

>What still baffles me is why doesnt that counter show up in the registry
>until I create a new record.

I don't quite know what you mean by this. After you add a new record on the table that had the Primary index, it should appear in the registry and then just be incremented as needed. You should be able to look at it in the Application Registry Editor and see what the last number added was.

>The codemine help states: The default counter key path
>is "Shared.Counters.Primary Key " + the table name.

>But the path of this counter is "ecnc_appreg01.counters.primary key
>tcalibrate" where ecnc is my project name and tcalibrate is the table.

Are you saying that in the Application Registry Editor, you don't see this in:

"ApplicationRegistry.Shared Keys.Counters.Primary Key YourTableName"

but rather in:

"Application Registry.ecnc_appreg01.counters.primary key tcalibrate" ?

You should see the first one.

>If I were to create this scenario myself, i would try to put the countr in
>the default location. How does it get created 'on the fly' in another
>location and still retain the old value? I guess im making too much of
>this, but i'd like to get a handle on whats happening. Thanks for your
>input..

If you delete it in the Application Editor, where does it appear the next time you add a record?

I can understand why you would like to figure it out.

Mel Cummings
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform