Donne
Oct 7th, 2000, 11:46 AM
I made the below code to detect ANSI colors but for some reason it simply does not work and if anyone can tell me why or tell me about a better way to detect ANSI colors please let me know.
TempBegin = 1
If InStr(1, WrkSpace, "37m") Then
Do While InStr(TempBegin, WrkSpace, "[1") > 0
TempBegin = InStr(TempBegin + 1, WrkSpace, "[1")
If TempBegin > InStr(1, WrkSpace, "37m") Then Exit Do
TempStrLength = Len(Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "37m") - TempBegin))
'MsgBox TempDebug = Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "30m") - TempBegin)
If TempStrLength < 11 & TempStrLength > 5 Then
WHITE = Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "37m") - TempBegin)
GoTo ContinueWHITE
End If
Loop
TempBegin = 1
Do While InStr(TempBegin, WrkSpace, "37m") > 0
TempBegin = InStr(TempBegin + 1, WrkSpace, "[1")
If TempBegin < InStr(1, WrkSpace, "37m") Then Exit Do
TempStrLength = Len(Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "[1") - TempBegin))
If TempStrLength > -11 & TempStrLength < -5 Then
WHITE = Mid(WrkSpace, TempBegin, InStr(1, wrkspack, "[1") - TempBegin)
GoTo ContinueWHITE
End If
Loop
'GoTo beginred
GoTo ContinueWHITE
End If
ContinueWHITE:
TempBegin = 1
If InStr(1, WrkSpace, "37m") Then
Do While InStr(TempBegin, WrkSpace, "[1") > 0
TempBegin = InStr(TempBegin + 1, WrkSpace, "[1")
If TempBegin > InStr(1, WrkSpace, "37m") Then Exit Do
TempStrLength = Len(Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "37m") - TempBegin))
'MsgBox TempDebug = Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "30m") - TempBegin)
If TempStrLength < 11 & TempStrLength > 5 Then
WHITE = Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "37m") - TempBegin)
GoTo ContinueWHITE
End If
Loop
TempBegin = 1
Do While InStr(TempBegin, WrkSpace, "37m") > 0
TempBegin = InStr(TempBegin + 1, WrkSpace, "[1")
If TempBegin < InStr(1, WrkSpace, "37m") Then Exit Do
TempStrLength = Len(Mid(WrkSpace, TempBegin, InStr(1, WrkSpace, "[1") - TempBegin))
If TempStrLength > -11 & TempStrLength < -5 Then
WHITE = Mid(WrkSpace, TempBegin, InStr(1, wrkspack, "[1") - TempBegin)
GoTo ContinueWHITE
End If
Loop
'GoTo beginred
GoTo ContinueWHITE
End If
ContinueWHITE: