|
-
May 17th, 2000, 01:44 AM
#1
Does anyone knows what has happened to PAD, PADL, PADR functions? Were they removed from VB6? I'm trying to use them but VB6 doesn't seem to recognise any of them. I used them so many times in previous versions, no problems. I have my own function which does the same thing, but I'm just curious. Thanx
-
May 17th, 2000, 03:17 AM
#2
Code:
'*********************************************************************
'Declarations section of the module.
'*********************************************************************
Option Explicit
Dim x As Integer
Dim PadLength As Integer
'=====================================================================
'The following function will left pad a string with a specified
'character. It accepts a base string which is to be left padded with
'characters, a character to be used as the pad character, and a
'length which specifies the total length of the padded result.
'=====================================================================
Function Lpad (MyValue$, MyPadCharacter$, MyPaddedLength%)
Padlength = MyPaddedLength - Len(MyValue)
Dim PadString As String
For x = 1 To Padlength
PadString = PadString & MyPadCharacter
Next
Lpad = PadString + MyValue
End Function
'=====================================================================
'The following function will right pad a string with a specified
'character. It accepts a base string which is to be right padded with
'characters, a character to be used as the pad character, and a
'length which specifies the total length of the padded result.
'=====================================================================
Function Rpad (MyValue$, MyPadCharacter$, MyPaddedLength%)
Padlength = MyPaddedLength - Len(MyValue)
Dim PadString As String
For x = 1 To Padlength
PadString = MyPadCharacter & PadString
Next
Rpad = MyValue + PadString
End Function
-
May 17th, 2000, 07:47 PM
#3
Thanx for the reply, but I was just wondering what happened to the functions, I already got similiar function.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|