Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Character strings---picking out substrings
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00125430
Message ID:
00125466
Vues:
11
Hi,

>I have to go through a table and choose part desriptions...I need to remove the string within the parentheses to place in a report. HELP!!
*!*********************************************
*!
*!       Procedure: within
*!
*!*********************************************
*) Description.......: Returns string contained within two
*)                     others.  Case sensitive
*] Dependencies......:
*  Calling Samples...: within( <expC>, <expC>, <expC> [,<expN> [,<expN>]])
*  Parameter List....: tcExpression
*                      tcLeft
*                      tcRight
*                      tnFirstOne
*                      tnFollowing

PROCEDURE within
PARAMETER tcExpression, tcLeft, tcRight, tnFirstOne, tnFollowing

LOCAL lcReturnVal, tnLeftpos
lcReturnVal = []
tnLeftpos = AT( tcLeft, tcExpression, IIF( EMPTY( tnFirstOne), 1, tnFirstOne))
IF tnLeftpos> 0
  tnLeftpos = tnLeftpos+LEN( tcLeft)
  IF tnLeftpos< LEN( tcExpression)
    lcReturnVal = SUBSTR( tcExpression, ;
                          tnLeftpos, ;
                          AT( tcRight, ;
                              SUBSTR( tcExpression, tnLeftpos), ;
                              IIF( EMPTY( tnFollowing), 1, tnFollowing))-1)
    ENDIF
ENDIF
RETURN lcReturnVal
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform