Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed this Code Up?
Message
From
05/07/2006 11:45:59
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01133775
Message ID:
01133861
Views:
12
That and a couple other tweeks did the trick. Thanks Sergey!!!!!

:o)

Tracy

>Hy Tracy,
>
>First, you should find out which part of code is bottleneck. Mabe it's multiple assigment of
THISFORM.Comments.VALUE = THISFORM.Comments.VALUE + " " + vstopvalue
>
>>The below code works and is located in the form init, however, I would like to speed it up if possible. Basically, a person can type on a command line something similar to:
>>
>>B10 TS 2004, TX, ABCD123, 109 N MAIN ST, 62" 132LBS MORE COMMENTS
>>
>>From left to right, the values signify, an id, the command, vehicle license tag, location, height,
>>weight, and additional comments. Actually the height and weight are part of the comments.
>>
>>Ideally the user would always enter information in this order:
>>
>>id
>>vehicle license tag
>>vehicle license tag state
>>vehicle license tag year
>>location
>>comments
>>
>>that is the order of the fields on the form itself which are populated with the values the user entered. Every separate field must be separated by a comma (to parse). Later it was decided that the user should be able to enter the values to populate the fields in any order after the TS is typed. So, anything after "TS" denotes data to populate the fields on the form. The "TS" tells the system which form to pass the values to. It is working, but this change means that I had to change the logic - for instance the user must be allowed to type a 2-digit or 4-digit year. Some vehicle tags have information which can be similar to a year (e.g. 4004 for a motorcycle tag). If the value entered equals a year less than three years old and no further into the future than 1 year, I can assume it is the vehicle year and not the vehicle tag (for our purposes). However, to determine that, I have to check for the year before anything else is done so that I can process it as a vehicle tag
>>if it doesn't match the > = year(date())-3 and < = year(date())+1 check. A vehicle tag cannot contain spaces (to differentiate it from the comments field). A location must always start with a number and contain at least one space (e.g. 100 N Main) or have no number but include a forward or backward slash (e.g. Main/Green). Although there is no specific field for height, weight, race, gender, etc, the user may type that information and it should go into the comments field. Anything not valid should go into the comments field.
>>
>>Ok, given the above, the code below works. However I would like to speed it up if possible. When the form loads, an image of the form displays before it is completely solid and populated with the values. The code has evolved over the changing of the requirements and I have probably looked at it too much so I am putting it out there for any takers to have fun with and see if the speed can be improved.
>>
><snip>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform