\hypertarget{group__range__functions}{}\section{Range\+Iterator helper functions}
\label{group__range__functions}\index{Range\+Iterator helper functions@{Range\+Iterator helper functions}}
\subsection*{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}


\subsection{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}
foreach int i in(\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(5))
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"i=%d\(\backslash\)n"}, i);
\textcolor{comment}{# resulting in:}
\textcolor{comment}{# i=0}
\textcolor{comment}{# i=1}
\textcolor{comment}{# i=2}
\textcolor{comment}{# i=3}
\textcolor{comment}{# i=4}
\textcolor{comment}{# i=5}
\end{DoxyCode}
 
\end{DoxyParagraph}


\subsection{Function Documentation}
\mbox{\Hypertarget{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}\label{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}} 
\index{Range\+Iterator helper functions@{Range\+Iterator helper functions}!xrange@{xrange}}
\index{xrange@{xrange}!Range\+Iterator helper functions@{Range\+Iterator helper functions}}
\subsubsection{\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}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(2, 5); \textcolor{comment}{# 2, 3, 4, 5}
\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(2, -2); \textcolor{comment}{# 2, 1, 0, -1, -2}
\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(1, 10, 5); \textcolor{comment}{# 1, 6}
\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(0, 10, 5); \textcolor{comment}{# 0, 5, 10}
\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(-10, 10, 5); \textcolor{comment}{# -10, -5, 0, 5, 10}
\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 R\+A\+N\+G\+E-\/\+E\+R\+R\+OR} 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 R\+A\+N\+G\+E\+I\+T\+E\+R\+A\+T\+O\+R-\/\+E\+R\+R\+OR} & 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}
Qore 0.\+8.\+6 

Qore 0.\+8.\+11.\+1 this function takes the optional {\itshape val} argument 
\end{DoxySince}
\mbox{\Hypertarget{group__range__functions_ga85798861f6ac3dc0adafaa8db337d8e5}\label{group__range__functions_ga85798861f6ac3dc0adafaa8db337d8e5}} 
\index{Range\+Iterator helper functions@{Range\+Iterator helper functions}!xrange@{xrange}}
\index{xrange@{xrange}!Range\+Iterator helper functions@{Range\+Iterator helper functions}}
\subsubsection{\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}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\mbox{\hyperlink{group__range__functions_gad5b4d3ad3f6c36d2e714bc6ed757a507}{xrange}}(1); \textcolor{comment}{# 0, 1}
\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}
Qore 0.\+8.\+6 
\end{DoxySince}
