|
ASC ASP String FunctionThe Asc function might seem obscure at first - who wants to know the ascii code for characters? But this actually can become quite important in data processing. Sure, if you're wondering if a character is the letter A you can just do a straight comparison if LetterInput = "A" then ... but there are special characters that can end up in strings that are much harder to test for. The two most notorious are the carriage return and the line feed. These are ascii strings 10 and 13. They can cause all sorts of formatting problems and cause your parsing to go haywire. To use the Asc function, you feed in a character and it returns the numeric ascii ID of that character. CodeNum = Asc(LetterInput) if CodeNum = 10 or CodeNum = 13 then response.write "Invalid Entry" ASP String Functions
All content copyright © 2008 Minerva WebWorks LLC. All rights reserved.
|
|