Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Easy one - function with table and field
Message
De
26/09/2004 20:43:00
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
26/09/2004 19:09:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00946132
Message ID:
00946149
Vues:
19
Hi Paul

How about this one? It only processes the records that need to be processed. It closes the table if it did open it. It reselects the original workarea when finished.
FUNCTION replacechar
LPARAMETERS m.tcTable, m.tcField
LOCAL m.lnSelect
m.lnSelect = SELECT()

LOCAL m.llCloseIt
IF USED(m.tcTable)
  m.llCloseIt = .F.
ELSE
  m.llCloseIt = .T.
  USE (m.tcTable) IN 0
ENDIF
SELECT (m.tcTable)

REPLACE ;
  (m.tcField) WITH STRTRAN(EVALUATE(m.tcField),"(",""), ;
  (m.tcField) WITH STRTRAN(EVALUATE(m.tcField),")","-") ;
  FOR "("$&tcField. OR ")"$&tcField.

IF m.llCloseIt = .T.
  USE IN SELECT(m.tcTable)
ENDIF

SELECT (m.lnSelect)
ENDFUNC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform