|
|
|
Click here to copy the following block |
Function StringToCode(ByVal Source As String) As String
Dim Index As Integer Dim acode As Integer Dim result As String Dim openQuotes As Boolean For Index = 1 To Len(Source) acode = Asc(Mid(Source, Index, 1)) If acode >= 32 Then If openQuotes = False Then result = result & """" openQuotes = True End If result = result & Chr(acode) If acode = 34 Then result = result & Chr(acode) Else If openQuotes Then result = result & """ & " openQuotes = False End If Select Case acode Case 0 result = result & "vbNullChar & " Case 13 result = result & "vbCr & " Case 10 result = result & "vbLf & " Case 9 result = result & "vbTab & " Case Else result = result & "Chr$(" & CStr(acode) & ") & " End Select End If Next If openQuotes Then result = result & """" ElseIf Right(result, 3) = " & " Then result = Left(result, Len(result) - 3) End If Do Index = InStr(result, "vbCr & vbLf") If Index = 0 Then Exit Do result = Left$(result, Index - 1) & "vbCrLf" & Mid$(result, Index + 11) Loop If Len(result) = 0 Then result = """""" StringToCode = result End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|