Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equivalent of Foxpro PADR, PADL Command
Message
 
À
25/01/2001 02:09:24
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00468346
Message ID:
00468401
Vues:
24
The LSET and RSET commands can duplicate the functionality of PADL and PADR

Example:
cX = space(20): cY = "TEST"
LSET cX = cY ' Produces 20 character string beginning with 'TEST'
RSET cX = cY

I suggest making a public function, in fact:

Public Function PADL(cString as String, nLen as Length, Optional cPadChar as String) AS STRING
Dim cTemp as String
cTemp = String(nLen,Iif(cPadChar=""," ",cPadChar))
LSET cTemp = cString
PADL = cTemp
End Function

Add this to the endless list of functions VFP has built-in, that VB
doesn't...

>Hi! I would like to know the equivalent of the Foxpro functions PADR() and PADL() in VB6. Can anyone tell me or do I have to create my own? Perhaps you're using your own similar function, maybe you can share it with me? Thanks!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform