Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speed this Code Up?
Message
 
 
À
05/07/2006 08:32:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01133775
Message ID:
01133809
Vues:
14
This message has been marked as a message which has helped to the initial question of the thread.
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>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform