Ghi
Quyền truy cập vào trang này yêu cầu sự cho phép. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Quyền truy cập vào trang này yêu cầu sự cho phép. Bạn có thể thử thay đổi thư mục.
You store a value in a variable by putting the variable name on the left side of an assignment statement.
Putting Data in a Variable
To store a value in a variable
Use the variable name on the left side of an assignment statement.
The following example sets the value of the variable
alpha.alpha = (beta * 6.27) / (gamma + 2.1)The value generated on the right side of the assignment statement is stored in the variable.
Getting Data from a Variable
You retrieve a variable's value by including the variable name in an expression.
To retrieve a value from a variable
Use the variable name in an expression. You can use a variable anywhere you can use a constant or a literal, except in an expression that defines the value of a constant.
-or-
Use the variable name following the equal (
=) sign in an assignment statement.The following example reads the value of the variable
startValueand then uses the value of the variablecounterin an expression.counter = startValue cellValue = (counter + 5) ^ 2The value of the variable participates in the expression just as a constant would, and then it is stored in the variable or property on the left side of the assignment statement.