web 2.0

How to use ASP & ASP/VBScript Dim

How to use ASP & ASP/VBScript Dim This the tutorial/example a scripts how to use ASP & Dim declare variable.

ShotDev Focus:
- ASP & Dim declare variable .

Option Explicit (When Option Explicit appears in a file, you must explicitly declare all variables using the Dim)

Example

asp_dim.asp

  1. <%  
  2. Option Explicit  
  3. %>  
  4. <html>  
  5. <head>  
  6. <title>ShotDev.Com Tutorial</title>  
  7. </head>  
  8. <body>  
  9. <%  
  10. Dim strSiteName  
  11. Dim strFullName,strNickName,strVersion  
  12. Dim arrVar(2)  
  13. strSiteName = "www.ShotDev.Com"  
  14. strFullName = "Mr.Weerachai Nukitram"  
  15. strNickName = "Win"  
  16. strVersion = "2010"  
  17. arrVar(0) = "www.ShotDev.Com"  
  18. arrVar(1) = "Mr.Weerachai Nukitram"  
  19. arrVar(2) = "Win"  
  20. Response.write(strSiteName&"<br>")  
  21. Response.write(strFullName&"<br>")  
  22. Response.write(strNickName&"<br>")  
  23. Response.write(strVersion&"<br>")  
  24. Response.write("<hr>")  
  25.   
  26. Dim i  
  27. For i = 0 To UBound(arrVar)  
  28. Response.write(arrVar(i)&"<br>")  
  29. Next  
  30. %>  
  31. </body>  
  32. </html>  

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_dim.asp

Screenshot

ASP & Dim

.

.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.