Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement