Hi all..
Im Sure something can explain some code I got
out of this site. Its a function by Yonatan , he
to be on a whole different level of vb then me.
So could someone explain this in ALOT of depth??
Code:Option Explicit ' Function version and sub version... Use the one which looks more fun! #Const FunctionVersion = True ' Change to False to use the Sub version #If FunctionVersion Then Function TrimNulls(ByVal sString As String) As String #Else Sub TrimNulls(sString As String) #End If Dim lPos As Long lPos = InStr(sString, vbNullChar) If lPos > 0 Then sString = Left(sString, lPos - 1) #If FunctionVersion Then TrimNulls = sString End Function #Else End Sub #End If




Reply With Quote