Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Design question
Message
 
To
17/01/2005 13:10:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00977521
Message ID:
00977827
Views:
24
It looks like one attempt to reply got lost in the UT hickup. Let's try again...
I wouldn't call it an 'interesting alternative' (as opposed to 'more elegant methods'), unless you consider OO design an interesting alternative to hard coding. For the moment it may seem simpler to leave the code as is, but that's about the only reason to not use a class. It does not matter that the objects are not moving, or that for now you only need to show the power.

>>>Now, I was wondering whether this was the best way to do this, or whether there were any more elegant methods to get the job done. Or simply, some interesting alternative to choose.


>Yes, that is an interesting alternative. Well, since in my case, the map objects are static, and the only thing that changes are the Labels, I think I will simply keep your idea handy for future reference.
>
>>Hi Hilmar,
>>We have a form that shows the movements and status of over 100 trains in our automated transit system. Trains are represented by objects of class train and the code in the class is responsible for moving the objects on the map and refreshing the appearance to show their status details like the consist (cars), faults, if the doors are open, etc. The class uses train status information contained in DBF tables, which are updated by other systems. The system is live, 24x7, and it refreshes every 1 sec, on a timer.
>>So, instead of checking for hard coded object names, the train objects, after they are created are self-contained.
>>
>>>One of my clients has a form, containing a map (drawn with standard VFP objects - mainly lines). Some labels should be placed on the form, in specific places. The map represents production and flow of electrical power in a certain region. The data is available in tables.
>>>
>>>There are several similar cases, but as an example, let's assume the power stations have letter codes, and the power produced should appear on the map, as captions. Let's say some sample data is:
>>>
>>>
>>>Station   Power
>>>AAA         5.3
>>>ABC         4.2
>>>...
>>>
>>>
>>>I suggested my client to give the corresponding Labels in the "map" form meaningful names, like LblAAA and LblABC, to make it possible for a program to easily fill in the data, by just generating the Label name, checking if the Label exists (there may be invalid data), and fill in the "Power" value.
>>>
>>>Now, I was wondering whether this was the best way to do this, or whether there were any more elegant methods to get the job done. Or simply, some interesting alternative to choose.
Doru
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform