Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of triggers
Message
 
 
À
07/12/2000 19:29:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00450619
Message ID:
00450697
Vues:
42
Trey,

Do you like conversion program? :) The only problem, it's hard to reply...
Anyway, few observations: use vartype instead of type. Type has overhead.
Something's wrong with this if endif condition:
>      IF !EMPTY(lcField2Val)
>        lcNameSearch=LOWER(lcField2Val)
>      ELSE
>        lcNameSearch=LOWER(lcField1Val)
>      ENDIF
>    ELSE
>      lcNameSearch=LOWER(lcField1Val)
>    ENDIF
You see, that I mean.

>
>LPARAMETERS tcTableName, tcField1, tcField2, tcFieldSearch
>LOCAL lcNameSearch, llOk, lcOnError, llError, lcField1Val, lcField2Val
>lcOnError=ON("ERROR")
>
>*-- initialize llOk to .T.
>
>llOk = .T.
>
>ON ERROR llError=.T.
>IF PCOUNT()=4 AND TYPE('tcTableName')="C" AND TYPE('tcField1')="C" AND TYPE('tcFieldSearch')="C"
>  IF USED(tcTableName)
>    IF  TYPE('tcField2')="C"
>
>      *-- store these to vars instead of evaluating them each time
>      *   also, use Eval() instead of macro expansion
>      *   ForceExt() is part of VFP6, prior to that it's in FoxTools.fll
>      lcField1Val = Eval(ForceExt(tcTableName,tcField1))
>      lcField2Val = Eval(ForceExt(tcTableName,tcField2))
>
>      IF !EMPTY(lcField2Val)
>        lcNameSearch=LOWER(lcField2Val)
>      ELSE
>        lcNameSearch=LOWER(lcField1Val)
>      ENDIF
>    ELSE
>      lcNameSearch=LOWER(lcField1Val)
>    ENDIF
>
>    *--     again, use Eval() instead of macro expansion
>    IF Eval(ForceExt(tcTableName,tcFieldSearch))lcNameSearch
>      *-- the record is already locked
>      **IF RLOCK(tcTableName)
>      REPLACE (tcFieldSearch) WITH lcNameSearch IN (tcTableName)
>      **UNLOCK IN (tcTableName)
>      llOk=not llError
>      **ENDIF
>    ENDIF
>  ENDIF
>ENDIF
>ON ERROR &lcOnError
>RETURN llOk
>
**************
>>Is it possible for you to find my problem?
>>Thank you again.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform