Home  |  Latest News  |  Contribute  |  F.A.Q.  |  Account  |  Scripts | About
Search ASPNut:
 
ASP Reference
Server Variables
ASP Glossary
Related Sites

Free Components

HTML Reference
Web Colors
Entities
CSS Level 1
Encode/Decode
Glossary

Our Sponsors
ASP Nuke CMS
Free Auctions
PHP 5 Script
Funktastic Blog
ULost Directory
Team Task

 

 

 

 

 

 

 

 

 

 

 

 

CByte

The CByte function will convert an ASP variant variable into a byte type. The byte type holds a numeric value from 0 to 255.

If an error occurs converting the value into a byte, the script will throw a runtime error. You can avoid this by creating an error handler around your conversion method as shown below:

Dim sValue
Dim nValue

sValue = 34.5
On Error Resume Next
nValue = CByte(sValue)
If Err.Number <> 0
    Response.Write "An error occurred converting to byte: " & sValue
End If
On Error Goto 0

Orvado Technologies

ASP Nuke CMS
Free Open Source
Content Manager
HomeFix Boards
Home Remodeling
Message Boards

Contact Us | Contribute | About | Site Map



"I like to listen. I have learned a great deal from listening carefully. Most people never listen." - Ernest Hemingway

©2007 Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.