Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple Grid Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00043566
Message ID:
00043779
Vues:
58
>>Ok then here's the text in activate section:
>>set excl off
>>clos all
>>use plist
>>appe blank
>> REPL UDATE WITH DATE()
>> REPL UTIME WITH TIME()
>> REPL VERSION WITH 'LMCAVFP!'
>> REPL OS1 WITH OS()
>> REPL OS2 WITH OS(0)
>
>It's better practice to replace the append and replace commands with:
>
>INSERT INTO pList ;
> (uDate, uTime, version, os1, os2) ;
> VALUES ;
> (DATE(), TIME(), 'LMCAVFP1', OS(), OS(0))
>
>That way, if you have or add indexes, they're only updated once, instead of once for each line.
>
>Also, you should spell out your commands: for example, is REPL REPLACE or REPLICATE()? :-) You'll be much happier when you have to maintain your code in a year....


Also, when you do use REPLACE, you can replace many fields in one statement...
REPLACE UDATE WITH DATE(),;
UTIME WITH TIME(),;
VERSION WITH 'LMCAVFP!',;
OS1 WITH OS(),;
OS2 WITH OS(0)

Although an INSERT INTO is faster than an APPEND BLANK followed by a REPLACE.

Timothy, have you set step on and traced through the code?

Joe
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform