Enable the Caps Lock (uppercase) Key Using VBScript
Source: Internet
Author: User
Q:
Hi, scripting guy! I have a script where users enter some information in an input box. the information needs to be entered in all-capital letters, so my instructions say, "Please make sure the Caps Lock key is on before entering the information. "They don't always do that, however. is there a way to turn the Caps Lock key on and off using a script?
-- BW, Medford, or
A:
Hey, BW. we don't know of a way to turn the Caps Lock key on and off, but we do know a way to mimic the effect of having the Caps Lock key on. after all, the whole point of the Caps Lock key is to turn everything you type into uppercase letters. for example, you might type this:
This is my sentence.
But Caps Lock will make it appear on screen like this:
This is my sentence.
So how can we achieve the same affect in a script? Simple: We just use the VBScript function ucase, which switches all the letters in a string to their uppercase equivalent. for example, here's a simple two-line script that gathers information from a user and then uses the ucase function to switch all the letters to uppercase when echoing the value to the screen:
Strmessage = inputbox ("Please enter your message:") wscript. Echo ucase (strmessage)
Incidentally, the above script doesn't actually change the case of the letters in the string strmessage; it just displays them in uppercase. if you really want all the letters converted to uppercase, try this script instead:
Strmessage = ucase (inputbox ("Please enter your message:") wscript. Echo strmessage
Looks crazy, but it works.
For more information about the ucase function, see thevbscript document on msdn.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.