Suppose you have a list of variables. You don’t want to type the name of each variable every time to define them within the function or array. You are looking for a shortcut to accomplish this task.
Create a dataset with a list of variables
How to specify a list of variables
A single dash (-) refers to specify consecutive numbered variables. For example: a1-a4;
A double dash (–) refers to specify variables based on the order of the variables as they appear/entered in the file, regardless of the name of the variables.
In the above program, a1-a4 includes a1, a2, a3 and a4, whereas a1--a4 includes a1, a3 and a4 only as they appear the same way in file.
How to specify all NUMERIC variables
How to use double dash in array
The below-defined program will subtract one from values in variables a1, a3 and a4.
How to use numeric variables in array
The below-defined program will subtract one from values in numeric variables.
- C# | Variables
- JS++ | Variables and Data Types
- How to drop variables from a dataset in SAS Programming?
- How to avoid Compile Error while defining Variables
- Difference between Increment and Decrement Operators
- Problem in comparing Floating point numbers and how to compare them correctly?
- Control Structures in Programming Languages
- I Can't Use Logic In Programming. What Should I Do?
- 7 Tips To Write Clean And Better Code in 2020
- I Can’t Do Computer Programming – 7 Common Myths You Must Know
- Find all the possible remainders when N is divided by all positive integers from 1 to N+1
- Hello World Program : First program while learning Programming
- Difference between Functional Programming and Object Oriented Programming
- Program to implement Logic Gates
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.