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 Functional Programming and Object Oriented Programming
- Program to implement Logic Gates
- Which Programming Language Should I Choose as a Beginner?
- Arrow operator -> in C/C++ with Examples
- 12 Reasons Why You Should Learn Python in 2019
- 5 Most Difficult Programming Languages of the World
- Object Oriented Programming in Ruby | Set-2
- Difference Between Programming, Scripting, and Markup Languages
- Walrus Operator in Python 3.8
- 7 Tips and Tricks to Learn Programming Faster
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.