ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Intro to ASP



 
Italian Wedding


ASC ASP String Function



The 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


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2008 Minerva WebWorks LLC. All rights reserved.



Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error