Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hacking the SCX - UniqueID
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00757755
Message ID:
00757781
Views:
31
This message has been marked as the solution to the initial question of the thread.
Hi Bob,

This is what object control is all about. Here is my solution:

I have a simliar system, but there is one major difference. In my 'mirror tables':
control_reference table - I have two fields: control_id and form_id. Each is TYPE N(6,0) in length.
control_issue table - one field: field control_id TYPE N(6,0).

Each and every object I use has a property called 'referenceid', TYPE N. For my system to work - this is crucial. Every object must have this property... shapes, lables, containers, images (which I store in containers).. etc...

As I create new forms, and then save them for use, I run my command set_formcontrols utility against that form. This simply checks on FOR EACH object in loForm...., the property 'referenceid' of each control, against the form_id value in teh control reference_table. If it finds it, it is okay. If it does not find it, then it is a new form control the user has added, so I add it to the control_reference table (getting the next control number from the control_issue table), against the current form_id.

Looking for 'deleted controls' is a bit trickier, so as the user opts to remove a control, at that point I run a check against the form contents and tag the row with the control_id/form_id as deleted.

HTH

Ric


>I've built a SCX hacking utility that reads the data from an SCX file, changes and replaces it. That works ok.
>
>However, I now want to maintain a mirrored database against the forms that keeps additional information that can be mapped back later to the controls in the form. It would know what controls had been deleted from the form, and what had been added. Each time it was run, it would scan the SCX, and find which controls were no longer in the form, and which had been added, by using a unique control identifier from the form.
>
>I was planning on using UNIQUEID, but find that in fact it isn't unique. I've also found some references that say it can change later, after the control was created. If UniqueID id not unique, what is it used for within FoxPro?
>
>I was thinking about using objectname+parent+UNIQUEID, but even that might have duplicates under some circumstances.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform