RepCad Posted June 22, 2020 Posted June 22, 2020 Hi all, I have a function to check if a string is hex or not in vba, can someone change or rewrite the function in autolisp? Public Function IsHex(strInput As String) As Boolean Dim i As Long IsHex = False If Len(strInput) = 0 Then Exit Function For i = 1 To Len(strInput) If Not (Mid$(strInput, i, 1) Like "[0-9a-hA-H]") Then Exit Function Next IsHex = True End Function Quote
Roy_043 Posted June 22, 2020 Posted June 22, 2020 (edited) (defun is-hex-p (str) (wcmatch str "~*[~0-9a-fA-F]*") ) Edited June 22, 2020 by Roy_043 Fixed hex range 1 Quote
Lee Mac Posted June 22, 2020 Posted June 22, 2020 (edited) H is not valid hex... Edited June 22, 2020 by Lee Mac 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.