ASP basic syntax

Source: Internet
Author: User

  • Create an ASP program

    ASP is a text file with the extension. asp, including text, HTML statements, ASP commands, and other scripting languages.
    ASP commands must be placed between "<%" and "%>"

  • Program Annotation

    In order to develop a good programming style, moderate comments are indispensable. ASP provides two comments
    1. But the quotation marks () are considered as comments in this line after the single quotation marks.
    2. rem keywords. The text after REM is considered as comments.

  • Assignment Statement

    In ASP, the value assignment statement of a common variable is "="
    Objects are assigned values using the set statement.

  • Arithmetic Operators
    Operator Function
    + ID
    - Negative number
    + Addition
    - Subtraction
    * Multiplication
    / Division
    \ Integer Division
    Mod Remainder
    ^ Index
  • Relational operators
    Operator Function
    = Equal
    <> Not equal
    < Less
    > Greater
    <= Less than or equal
    > = Greater than or equal
    IS Whether the comparison variable points to the same object
  • Logical operators

    The logical operators of ASP include:
    1. NOT reverse the logic Value
    2. AND "AND" or "AND" operations
    3. OR "OR" Operation
    4. XOR "exclusive or" operation
    5. EPV determines that the two expressions have equal logic and the same result is true. Otherwise, the two expressions are false.
    6. IMP checks whether two expressions are logically related.

  • String Operators

    ASP has only one string operator, which can force two expressions to connect strings.

  • Variable Declaration

    Note that
    1. The valid variable name cannot exceed 255 characters
    2. The variable name must start with a letter.
    3. The variable name must be unique within the same valid range.

    Variable declaration DIM variable name
    Constant statement CONST constant name = constant value

  • Data Type

    For ASP, it only has one Variant (Common variable) data type, which is a very special data type. You can specify any data type to this variable, such as Boolean, byte, integer, long integer, single-precision floating point, double-precision floating point, currency, date, and so on.


  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.