-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChr-Asc.vbs
24 lines (22 loc) · 924 Bytes
/
Chr-Asc.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'--use this script to obtain the ascii code for a character or the character for an ascii code.
dim r, m
m = msgbox("YES: To ENTER ASCII code." & vbcrlf & "NO: To ENTER CHARACTER.", 36, "Chr and Asc Conversion")
if m = 6 then
r = inputbox("Enter ascii code.", "Chr conversion")
if isnumeric(r) = false then
msgbox "Not a valid entry.", 16, "Cannot convert"
wscript.Quit
end if
if r > -1 and r < 256 then
msgbox "-" & chr(r) & "-"
else
msgbox "Not a valid entry.", 16, "Cannot convert"
end if
else
r = inputbox("Enter character.", "Asc conversion")
if len(r) = 1 then
msgbox asc(r)
else
msgbox "Must be only 1 character.", 16, "Cannot Convert"
end if
end if