\doxysection{Range\+Iterator helper functions}
\hypertarget{group__range__functions}{}\label{group__range__functions}\index{RangeIterator helper functions@{RangeIterator helper functions}}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_range_iterator}{Range\+Iterator}} \mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{Qore\+::xrange}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{start}}, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} stop, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{step}}=1, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} val)
\begin{DoxyCompactList}\small\item\em Returns a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator} containing an arithmetic progression of integers. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_range_iterator}{Range\+Iterator}} \mbox{\hyperlink{group__range__functions_ga85798861f6ac3dc0adafaa8db337d8e5}{Qore\+::xrange}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} stop)
\begin{DoxyCompactList}\small\item\em Returns a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator} containing an arithmetic progression of integers with start = 0 and step = 1. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\doxylink{class_qore_1_1_range_iterator}{Range\+Iterator} helper functions allow to use Range\+Itartor in easier usage in loop statements.

\begin{DoxyParagraph}{Example}

\begin{DoxyCode}{0}
\DoxyCodeLine{foreach\ int\ i\ \textcolor{keywordflow}{in}\ (xrange(5))\ \{}
\DoxyCodeLine{\ \ \ \ printf(\textcolor{stringliteral}{"{}i=\%d\(\backslash\)n"{}},\ i);}
\DoxyCodeLine{\}}
\DoxyCodeLine{\textcolor{comment}{\#\ resulting\ in:}}
\DoxyCodeLine{\textcolor{comment}{\#\ i=0}}
\DoxyCodeLine{\textcolor{comment}{\#\ i=1}}
\DoxyCodeLine{\textcolor{comment}{\#\ i=2}}
\DoxyCodeLine{\textcolor{comment}{\#\ i=3}}
\DoxyCodeLine{\textcolor{comment}{\#\ i=4}}

\end{DoxyCode}
 
\end{DoxyParagraph}


\doxysubsection{Function Documentation}
\Hypertarget{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}\label{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507} 
\index{RangeIterator helper functions@{RangeIterator helper functions}!xrange@{xrange}}
\index{xrange@{xrange}!RangeIterator helper functions@{RangeIterator helper functions}}
\doxysubsubsection{\texorpdfstring{xrange()}{xrange()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_range_iterator}{Range\+Iterator}} Qore\+::xrange (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{start,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{stop,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{step = {\ttfamily 1},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}}}]{val }\end{DoxyParamCaption})}



Returns a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator} containing an arithmetic progression of integers. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{xrange(2,\ 5);\ \textcolor{comment}{\#\ 2,\ 3,\ 4}}
\DoxyCodeLine{xrange(2,\ -\/2);\ \textcolor{comment}{\#\ 2,\ 1,\ 0,\ -\/1}}
\DoxyCodeLine{xrange(1,\ 10,\ 5);\ \textcolor{comment}{\#\ 1,\ 6}}
\DoxyCodeLine{xrange(0,\ 10,\ 5);\ \textcolor{comment}{\#\ 0,\ 5}}
\DoxyCodeLine{xrange(-\/10,\ 10,\ 5);\ \textcolor{comment}{\#\ -\/10,\ -\/5,\ 0,\ 5}}
\DoxyCodeLine{xrange(10,\ -\/10,\ 5);\ \textcolor{comment}{\#\ 10,\ 5,\ 0,\ -\/5}}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em start} & the initial value \\
\hline
{\em stop} & the final value \\
\hline
{\em step} & the step; the default is 1; must be greater than 0; the function throws a {\ttfamily RANGE-\/\+ERROR} exception when this argument is \texorpdfstring{$<$}{<} 1 \\
\hline
{\em val} & an optional value to be returned instead of the default integer value\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Returns} & a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator} containing an arithmetic progression of integers.\\
\hline
\end{DoxyRetVals}

\begin{DoxyExceptions}{Exceptions}
{\em RANGEITERATOR-\/\+ERROR} & this exception is thrown if {\ttfamily step} \texorpdfstring{$<$}{<} 1\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__list__functions_ga0bf214ec2c777032a6078bd979637e69}{range}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
the main difference between \doxylink{group__list__functions_ga0bf214ec2c777032a6078bd979637e69}{range()} and \doxylink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()} is that range returns a real list and \doxylink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()} returns a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator}
\end{DoxyNote}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+6
\item Qore 0.\+8.\+11.\+1 this function takes the optional {\itshape val} argument
\item Qore 0.\+9.\+5 does not include the upper limit in the range unless \doxysectlink{parse_directives_broken-range}{\%broken-\/range}{1} is set 
\end{DoxyItemize}
\end{DoxySince}
\Hypertarget{group__range__functions_ga85798861f6ac3dc0adafaa8db337d8e5}\label{group__range__functions_ga85798861f6ac3dc0adafaa8db337d8e5} 
\index{RangeIterator helper functions@{RangeIterator helper functions}!xrange@{xrange}}
\index{xrange@{xrange}!RangeIterator helper functions@{RangeIterator helper functions}}
\doxysubsubsection{\texorpdfstring{xrange()}{xrange()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_range_iterator}{Range\+Iterator}} Qore\+::xrange (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{stop }\end{DoxyParamCaption})}



Returns a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator} containing an arithmetic progression of integers with start = 0 and step = 1. 

This is an overloaded version of xrange(int, int, int) meaning {\ttfamily xrange}(0, {\ttfamily stop}, 1)

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{xrange(1);\ \textcolor{comment}{\#\ 0}}
\DoxyCodeLine{xrange(-\/3);\ \textcolor{comment}{\#\ 0,\ -\/1,\ -\/2}}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em stop} & the final value\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Returns} & a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator} containing an arithmetic progression of integers with start = 0 and step = 1.\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\doxylink{group__list__functions_ga0bf214ec2c777032a6078bd979637e69}{range}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
the main difference between \doxylink{group__list__functions_ga0bf214ec2c777032a6078bd979637e69}{range()} and \doxylink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()} is that \doxylink{group__list__functions_ga0bf214ec2c777032a6078bd979637e69}{range()} returns a real list and \doxylink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()} returns a \doxylink{class_qore_1_1_range_iterator}{Range\+Iterator}
\end{DoxyNote}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+6
\item Qore 0.\+9.\+5 does not include the upper limit in the range unless \doxysectlink{parse_directives_broken-range}{\%broken-\/range}{1} is set 
\end{DoxyItemize}
\end{DoxySince}
