@set statement

Source: Internet
Author: User
Tags expression variables variable
Statement

Use conditional compilation statements to create variables.

@set @varname = term

Parameters

VarName

Required option. A valid JScript variable name. You must always place a "@" character in front of you.

Term

Required option. 0 or more unary operators, followed by a constant, conditional-compilation variable, or an expression enclosed in parentheses.

Description

Conditional compilation supports numbers and Boolean variables. String not supported. Variables created with @set are usually used in conditional compilation statements, but can also be used anywhere in JScript code.

The example of a variable declaration looks as follows:

@set @myvar1 = 12@set @myvar2 = (@myvar1 * 20)@set @myvar3 = @_jscript_version

The following operators are supported in an expression enclosed in parentheses:

    • ! ~
    • * / %
    • + -
    • << >> >>>
    • < <= > >=
    • == != === !==
    • & ^ |
    • && | |

If the variable is used before the variable is defined, its value is NaN. NaN can be checked with @if statement:

@if (@newVar != @newVar)...

This succeeds because NaN is not equal to its own unique value.

Requirements

Version 3

Please see

Conditional Compilation | conditional Compilation Variables | @cc_on Statement | @if Statement



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.