Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Easy one - function with table and field
Message
De
26/09/2004 17:23:59
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Easy one - function with table and field
Divers
Thread ID:
00946132
Message ID:
00946132
Vues:
65
Hi everyone:

I think I have an easy one here for anyone willing to help. Unfortunately, I have spent a number of hours on this and I can't make it work.

I have a function to replace two character portions of a field in a table (see below) with two parameters, one a table (tctable), and the other a field (cfield). Unfortunately, when I pass a field name to the function, it either doesn't work (the variable cfield is not valid) or it replaces the value in the field with the name passed to it, ie "cfield". I am not sure how to pass the field name to the function so that the changes are being made to the actual field values.

any suggestions? thanks.

FUNCTION replacechar(tctable, cfield)
CLOSE ALL
USE (tctable)
GO top
SCAN
oldstring = 'cfield'
newstring1 = STRTRAN(oldstring,'(', '')
newstring2 = strTRAN(newstring1,') ','-')
replace 'cfield' WITH newstring2
ENDSCAN
ENDfunc
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform