পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Monday, February 6, 2017

Rexx - Variables

In Rexx, all variables are bound with the ‘=’ statement. Variable names are sometimes referred to as symbols. They may be composed of Letters, Digits, and Characters such as ‘. ! ? _’. A variable name you create must not begin with a digit or a period. A simple variable name does not include a period. A variable name that includes a period is called a compound variable and represents an array or table.

The following are the basic types of variables in Rexx which were also explained in the previous chapter −
  • Integers − This is used to represent an integer or a float. An example for this is 10.
  • Big integers − This represents a large integer value.
  • Decimal − A decimal value is a string of numerics that contains a decimal point but no exponent identifier.
  • Float − A float value is a string that represents a number in the scientific notation.
  • String − A series of characters defines a string in Rexx.

Different Types of Variable Functions

In this section, we will discuss regarding the various functions a variable can perform.

Variable Declarations

The general syntax of defining a variable is shown as follows −
var-name = var-value 
where
  • var-name − This is the name of the variable.
  • var-value − This is the value bound to the variable.
The following program is an example of the variable declaration −
Example
/* Main program */ 
X = 40 
Y = 50 
Result = X + Y 
say Result
In the above example, we have 2 variables, one is X which is bound to the value 40 and the next is Y which is bound to the value of 50. Another variable called Result is bound to the addition of X and Y.
The output of the above program will be as follows −
90

Naming Variables

Variable names are sometimes referred to as symbols. They may be composed of Letters, Digits, and Characters such as ‘. ! ? _’ . A variable name you create must not begin with a digit or period.
If a variable has not yet been assigned a value, it is referred to as uninitialized. The value of an uninitialized variable is the name of the variable itself in uppercase letters.
An example of an unassigned variable is as follows −
Example
/* Main program */ 
unassignedvalue 
say unassignedvalue 
If you run the above program you will get the following output −
UNASSIGNEDVALUE: command not found
   2 *-* unassignedvalue 
   >>>   "UNASSIGNEDVALUE" 
   +++   "RC(127)"
UNASSIGNEDVALUE
Variables can be assigned values more than once. The below program shows how the value of X can be assigned a value multiple times.
Example
/* Main program */ 
X = 40 
X = 50 
say X 
The output of the above program will be as follows −
50

Printing Variables

The values of variables are printed using the say command. Following is an example of printing a variety number of variables.
Example
/* Main program */ 
X = 40 

/* Display an Integer */ 
say X 
Y = 50.5 

/* Display a Float */ 
say Y 
Z = "hello" 

/* Display a string */ 
say Z 
The output of the above program will be as follows −
40 
50.5 
hello 

No comments:

Post a Comment