|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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! |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
Oh ok.. now i get it
![]() thank you VERY much! ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Newbie in ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|