软件技术专业外文翻译

更新时间:2023-05-25 07:26:43 阅读: 评论:0

英文资料翻译
ASP Language Basics
Active Server Pages (ASP) is a proven, well-established technology for building dynamic Web applications, which provides the power and flexibility you need to create anything from a personal, Web bad photo gallery to a complete catalogue and shopping cart system for your next eCommerce project. One unique feature of ASP is that it lets you choo your favourite scripting language, be it JavaScript or VBScript; however, VBScript is by far the most popular choice. In this article, I'll bring you up to speed on the basic syntax of the VBScript language, including variables, operators, and control structures.
This article is the cond in a ries teaching ASP. Specifically, the goal of this ries is to teach you all you need to know to create dynamic Web sites using ASP. This article picks up right where the previous article in the ries, Getting Started with ASP, left off.
V ariables
Here is the listing for the first ASP script I helped you create in the previous article:
1<html>
2<head>
3<title> My First ASP Page </title>
4</head>
5<body>成人高考英语试题
6<%
7' Write out a simple HTML paragraph
8Respon.Write "<p>This is a test of ASP.</p>"
9%>
10</body>
11</html>
As I admitted in that article, this is a pretty uninteresting example of an ASP script. When it comes right down to it, this script doesn't do anything a plain, old HTML page couldn't do. Oh sure, I gave a slightly more interesting example that displayed the current rver time, but to be really uful a script needs to perform some form of calculation, or manipulate dynamic information to prent it in some interesting way.
The language ud for writing most ASP programs, and which I'll be using throughout this ries, is called VBScript. Like most programming languages, VBScript lets you store data in variables. A variable may be thought of simply as a named location in memory where data may be stored. VBScript is what is known as a looly typed language, which means that a particular variable may store any kind of information, be it a number, a piece of text, a date, or some more complicated chunk of data (as oppod to strictly typed languages where you can only store one kind of information in each variable). Before you can u a variable, though, you must declare it; that is, you must let ASP know that you want to create a variable with a particular name.
Let's look at a basic example to help solidify the concepts in your mind. Say you were writing a Web page that performed conversions between Celsius and Fahrenheit temperatures. In countries where Celsius is ud, 20°C is commonly accepted as the value for room temperature. The following
code creates a variable called intRoomTempC, and then assigns it a value of 20:
New Revid 2nd Edition Out NOW!prey
"Build Y our Own Databa Driven Website Using PHP & MySQL"
Fully updated for PHP 4.3.
Installation instructions for Mac OS X
wtf什么意思
Full index provided奥斯卡主持人
New wider book size
Enhanced fonts
New cover design
logisticsLay-flat spine
All content revisited
hugo
Download the First 4 Chapters FREE
Tell me more about this top-lling book.
Dim intRoomTempC ' Create a variable
wkgintRoomTempC = 20 ' Assign the variable a value of 20
The keyword Dim in the above is short for dimension, and is ud to tell VBScript to create a variable with the name specified (in this ca, intRoomTempC). Why 'dimension', you ask? I agree, it's not the most obvious choice, but basically it refers to what you're asking VBScript to do. When creating a variable, VBScript needs to assign some space in memory to store whatever value(s) will be placed in the variable, and part of that task is to figure out the size (dimension) of the space that needs to be allocated. In any ca, creating a variable is as simple as typing Dim followed by the name of the variable.
The cond line of the above example assigns a value to the variable that was just created; specifically, it stores the number 20 in the variable. The equals sign (=) is called the assignment operator becau it is ud to assign values to variables. During the cour of this article, you'll meet
many other operators that do other weird and wonderful things to variables and the values they store.
Y ou should always create a variable before assigning it a value, and you'll usually want to assign the variable a value before putting it to u. Trying to assign a value to a variable that does not exist, however, will cau VBScript to automatically create a new variable with the given name. This is called implicit declaration, becau a new variable is declared implicitly as a result of your trying to assign a value to a variable that doesn't exist. Since you are free to u implicit declaration for all of your variables, you may be wondering what the point is of using the Dim command to create each and every variable by hand.
The answer has to do with how easy you want it to be to find typing mistakes in your code. VBScript provides another command, Option Explicit, which caus ASP to disallow implicit declarations and instead display an error message whenever you try to assign a value to a non-existent variable. Why would you want this to happen? Consider the following example:
Dim intRoomTempC ' Create a variable
intRomTempC = 20 ' Assign the variable a value of 20
If you have a keen eye, you may have noticed that the variable name is misspelled on the cond line. This is the kind of mistake that even experienced programmers make all the time. With implicit declaration enabled, the cond line will create another new variable called intRomTempC and will store the value in that variable instead. Now, if the rest of your script expects that value to be stored in intRoomTempC, you're going to run into trouble. In a large script, tracing such a problem back to one little typing mistake can be very time consuming. That's where Option Explicit comes in:
Option Explicit ' Disable implicit declaration
Dim intRoomTempC ' Create a variabledrunk是什么意思
intRomTempC = 20 ' Assign the variable a value of 20
This time, ASP will report the typing mistake as an illegal implicit declaratio n, displaying an error message to that effect with the exact line number where the typing mistake was made. For this reason, I tend to explicitly declare all my variables with Dim and specify Option Explicit on the first line of all of my ASP scripts. It might take slightly longer to type, but it saves a lot of headaches when something goes wrong.
A shortcut exists for creating veral variables at once on the same line. For instance, the following line would create two variables, intRoomTempC, and intFreezingC:
Dim intRoomTempC, intFreezingC ' Two variables in one line
By now you may be wondering about my naming convention for variables. The
two variables created in the above snippet both begin with int. I'm using this prefix to indicate that the variables will contain integers (whole numbers). Y ou can feel free to name your variables whatever you like and store whatever kind of data you like in them, but I prefer to u this convention as a helpful reminder of the type of information in each variable. This practice of prefixing variable names with a clue as to their type is known as Hungarian notation, and I'll introduce additional prefixes for other data types as they ari over the cour of this ries.
The Web has grown beyond the point where an online brochure will satisfy a typical company's needs for its Web prence. If you aim to market yourlf as a Webmaster the days, you need to have some skill building online applications –Web sites that urs can interact with, whether to get something done (e.g. nd email), get information targeted to their specific needs (e.g. a real-time stock quote), or to interact with other urs (e.g. an online community).
什么是同位语从句In this ries of articles, I’ll guide you through the process of learning one of the most popular frameworks for creating dynamic Web sites such as the –Active Server Pages (ASP). If you can cure a strong knowledge of ASP, as well as some practical experience building Web sites with it, you should never have trouble getting work as a Web developer. A quick arch of your favourite online job directory with the keyword 'ASP' should be more than enough to convince you of that.
In this first article, I'll help you get your feet wet by introducing the VBScript programming language, and how to u it to write dynamic Web pages with ASP. Before I get to that, I shall stop to explain how rver-side scripting, and ASP in particular, differs from other Web scripting technologies that you may be familiar with, such as client-side JavaScript. This will get you armed with the proper vocabulary and ensure that we're on the same page before launching headlong into the brave, new world of ASP.
Server-Side Scripting
To understand where ASP fits into the big picture of Web development, you need to understand the concept of a rver-side scripting language. If you've programmed Web pages in Perl, PHP, JSP, or Cold Fusion before, you can safely skip this ction –
劝说英文

本文发布于:2023-05-25 07:26:43,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/121823.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图