Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent of Foxpro PADR, PADL Command
Message
 
To
25/01/2001 02:09:24
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00468346
Message ID:
00468401
Views:
29
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!
Previous
Reply
Map
View

Click here to load this message in the networking platform