Thread: Newbie in ASP

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0

    Unhappy Newbie in ASP


    Hello!
    I've never programmed in ASP, but now I have to, and I don't understand this line:
    Server.CreateObject("Scripting.Dictionary")

    and this line:
    <%language = vbscript%>

    can anyone explain me what they do?
    thank you very much!
  2. #2
  3. No Profile Picture
    Demonic Swordsman DGQB
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2003
    Posts
    1,043
    Rep Power
    83
    Hi,

    the second line specifies that the Scripting language to use for your page will be VBScript. ASP can be written in VBScript, JavaScript, Perl, or Python. (ASP.NET can be written in C#, VB.NET, or JScript.NET)

    The first line I can't tell you for sure, but it looks like you're creating a Scripting.Dictionary object. So if you do
    Code:
    dim variable 1
    Set variable1 = Server.CreateObject("Scripting.Dictionary")
    you can then do some manipulation with that obj, which inherits the properties of the Dictionary class.

    You should have some basic programming experience before diving into ASP.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0
    Thank you very much!
    I still didn't get the second one line

    By the way I have programming experience in PHP, VB and Java I need to know ASP now because i gotta rewrite a web-site from ASP to PHP.. but anyways thanx!
  6. #4
  7. No Profile Picture
    Demonic Swordsman DGQB
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2003
    Posts
    1,043
    Rep Power
    83
    For the second line <%language = vbscript%>

    the alternatives would be <%language = javascript%> or <%language = perl%>

    This line specifies which language the interpreter should interpret. The default is VBScript. So if you don't have this line, the interpreter assumes you are writing in VBScript (I think). However, if you specify the language = Javascript, then the interpreter will interpret everything in javascript.

    For example, consider this code, written in vbscript:
    Code:
    <%@Language="vbscript">
    dim script
    if script = "vbscript" then
        response.write("vbscript")
    end if
    You would write the same thing in javascript with different syntax:

    Code:
    <%@Language="javascript">
    var script;
    if script == "vbscript"
    {
        document.write("vbscript");
    }
    Hopefully, you can see the purpose of the line. You CANNOT do this:

    Code:
    <%@Language="VBScript">
    var script;
    if script == "vbscript"
    {
        document.write("vbscript");
    }
    Here, The line specifies vbscript as the language, but in fact the code is written in Javascript. The interpreter would give an error.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0
    Oh ok.. now i get it
    thank you VERY much!

IMN logo majestic logo threadwatch logo seochat tools logo