\hypertarget{group__range__functions}{}\doxysection{Range\+Iterator helper functions}
\label{group__range__functions}\index{RangeIterator helper functions@{RangeIterator helper functions}}
\doxysubsection*{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}} start, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} stop, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} step=1, auto val)
\begin{DoxyCompactList}\small\item\em Returns a \mbox{\hyperlink{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 \mbox{\hyperlink{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}
\mbox{\hyperlink{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 in(\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(5))}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}i=\%d\(\backslash\)n"{}}, i);}
\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}}
\DoxyCodeLine{\textcolor{comment}{\# i=5}}

\end{DoxyCode}
 
\end{DoxyParagraph}


\doxysubsection{Function Documentation}
\mbox{\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[{auto}]{val }\end{DoxyParamCaption})}



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

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

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

\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 $<$ 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 \mbox{\hyperlink{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} $<$ 1\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__list__functions_gaad3b9056f1b0dfef032d130c7500f517}{range}}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
the main difference between \mbox{\hyperlink{group__list__functions_gaad3b9056f1b0dfef032d130c7500f517}{range()}} and \mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()}} is that range returns a real list and \mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()}} returns a \mbox{\hyperlink{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 \mbox{\hyperlink{parse_directives_broken-range}{\%broken-\/range}} is set 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\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 \mbox{\hyperlink{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\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}

\end{DoxyParagraph}

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

\begin{DoxyRetVals}{Return values}
{\em Returns} & a \mbox{\hyperlink{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}
\mbox{\hyperlink{group__list__functions_gaad3b9056f1b0dfef032d130c7500f517}{range}}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
the main difference between \mbox{\hyperlink{group__list__functions_gaad3b9056f1b0dfef032d130c7500f517}{range()}} and \mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()}} is that \mbox{\hyperlink{group__list__functions_gaad3b9056f1b0dfef032d130c7500f517}{range()}} returns a real list and \mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange()}} returns a \mbox{\hyperlink{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 \mbox{\hyperlink{parse_directives_broken-range}{\%broken-\/range}} is set 
\end{DoxyItemize}
\end{DoxySince}
