-
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
-
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
-
Thanx for the reply, but I was just wondering what happened to the functions, I already got similiar function.