\hypertarget{group__context__functions}{}\section{Context Functions}
\label{group__context__functions}\index{Context Functions@{Context Functions}}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{group__context__functions_gaf0dfc0d47bd06a2c1a6e76e3381f61eb}{Qore\+::cx\+\_\+first} ()
\begin{DoxyCompactList}\small\item\em Returns \hyperlink{basic_data_types_True}{True} if currently iterating the first element in a \hyperlink{statements_context}{context statement}, \hyperlink{basic_data_types_False}{False} if not. \end{DoxyCompactList}\item 
bool \hyperlink{group__context__functions_gad5b21ea6273b824301e13be824205957}{Qore\+::cx\+\_\+last} ()
\begin{DoxyCompactList}\small\item\em Returns \hyperlink{basic_data_types_True}{True} if currently iterating the last element in a \hyperlink{statements_context}{context statement}, \hyperlink{basic_data_types_False}{False} if not. \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int} \hyperlink{group__context__functions_gaf6605e041e703be65489058a15055ea7}{Qore\+::cx\+\_\+pos} ()
\begin{DoxyCompactList}\small\item\em Returns the current row number within the active \hyperlink{statements_context}{context statement} (starting from 0) \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int} \hyperlink{group__context__functions_ga31bcc663a5fb7d93585a051c9b0ca694}{Qore\+::cx\+\_\+total} ()
\begin{DoxyCompactList}\small\item\em Returns the total number of rows within the active \hyperlink{statements_context}{context statement}. \end{DoxyCompactList}\item 
auto \hyperlink{group__context__functions_ga105b00b74b4fba117cbf3582d1ad7363}{Qore\+::cx\+\_\+value} (\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} key)
\begin{DoxyCompactList}\small\item\em Returns the current value of the given column while iterating a \hyperlink{statements_context}{context statement}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}


\subsection{Function Documentation}
\mbox{\Hypertarget{group__context__functions_gaf0dfc0d47bd06a2c1a6e76e3381f61eb}\label{group__context__functions_gaf0dfc0d47bd06a2c1a6e76e3381f61eb}} 
\index{Context Functions@{Context Functions}!cx\+\_\+first@{cx\+\_\+first}}
\index{cx\+\_\+first@{cx\+\_\+first}!Context Functions@{Context Functions}}
\subsubsection{\texorpdfstring{cx\+\_\+first()}{cx\_first()}}
{\footnotesize\ttfamily bool Qore\+::cx\+\_\+first (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \hyperlink{basic_data_types_True}{True} if currently iterating the first element in a \hyperlink{statements_context}{context statement}, \hyperlink{basic_data_types_False}{False} if not. 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if currently iterating the first element in a \hyperlink{statements_context}{context statement}, \hyperlink{basic_data_types_False}{False} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
context (ds.select(sql)) \{
    \textcolor{keywordflow}{if} (\hyperlink{group__context__functions_gaf0dfc0d47bd06a2c1a6e76e3381f61eb}{cx\_first}())
        \hyperlink{group__string__functions_ga996c5d1686fbc245f0bc7a02012e6a33}{print}(\textcolor{stringliteral}{"first row!\(\backslash\)n"});
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em C\+O\+N\+T\+E\+X\+T-\/\+E\+R\+R\+OR} & this exception is thrown if called without an active \hyperlink{statements_context}{context statement}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\mbox{\Hypertarget{group__context__functions_gad5b21ea6273b824301e13be824205957}\label{group__context__functions_gad5b21ea6273b824301e13be824205957}} 
\index{Context Functions@{Context Functions}!cx\+\_\+last@{cx\+\_\+last}}
\index{cx\+\_\+last@{cx\+\_\+last}!Context Functions@{Context Functions}}
\subsubsection{\texorpdfstring{cx\+\_\+last()}{cx\_last()}}
{\footnotesize\ttfamily bool Qore\+::cx\+\_\+last (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \hyperlink{basic_data_types_True}{True} if currently iterating the last element in a \hyperlink{statements_context}{context statement}, \hyperlink{basic_data_types_False}{False} if not. 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if currently iterating the last element in a \hyperlink{statements_context}{context statement}, \hyperlink{basic_data_types_False}{False} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
context (ds.select(sql)) \{
    \textcolor{keywordflow}{if} (\hyperlink{group__context__functions_gad5b21ea6273b824301e13be824205957}{cx\_last}())
        \hyperlink{group__string__functions_ga996c5d1686fbc245f0bc7a02012e6a33}{print}(\textcolor{stringliteral}{"last row!\(\backslash\)n"});
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em C\+O\+N\+T\+E\+X\+T-\/\+E\+R\+R\+OR} & this exception is thrown if called without an active \hyperlink{statements_context}{context statement}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\mbox{\Hypertarget{group__context__functions_gaf6605e041e703be65489058a15055ea7}\label{group__context__functions_gaf6605e041e703be65489058a15055ea7}} 
\index{Context Functions@{Context Functions}!cx\+\_\+pos@{cx\+\_\+pos}}
\index{cx\+\_\+pos@{cx\+\_\+pos}!Context Functions@{Context Functions}}
\subsubsection{\texorpdfstring{cx\+\_\+pos()}{cx\_pos()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int} Qore\+::cx\+\_\+pos (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current row number within the active \hyperlink{statements_context}{context statement} (starting from 0) 

\begin{DoxyReturn}{Returns}
the current row number within the active \hyperlink{statements_context}{context statement} (starting from 0)
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
context (ds.select(sql)) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"row %d/%d:\(\backslash\)n"}, \hyperlink{group__context__functions_gaf6605e041e703be65489058a15055ea7}{cx\_pos}(), \hyperlink{group__context__functions_ga31bcc663a5fb7d93585a051c9b0ca694}{cx\_total}());
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em C\+O\+N\+T\+E\+X\+T-\/\+E\+R\+R\+OR} & this exception is thrown if called without an active \hyperlink{statements_context}{context statement}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\mbox{\Hypertarget{group__context__functions_ga31bcc663a5fb7d93585a051c9b0ca694}\label{group__context__functions_ga31bcc663a5fb7d93585a051c9b0ca694}} 
\index{Context Functions@{Context Functions}!cx\+\_\+total@{cx\+\_\+total}}
\index{cx\+\_\+total@{cx\+\_\+total}!Context Functions@{Context Functions}}
\subsubsection{\texorpdfstring{cx\+\_\+total()}{cx\_total()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int} Qore\+::cx\+\_\+total (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the total number of rows within the active \hyperlink{statements_context}{context statement}. 

\begin{DoxyReturn}{Returns}
the total number of rows within the active \hyperlink{statements_context}{context statement}
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
context (ds.select(sql)) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"row %d/%d:\(\backslash\)n"}, \hyperlink{group__context__functions_ga31bcc663a5fb7d93585a051c9b0ca694}{cx\_total}(), \hyperlink{group__context__functions_ga31bcc663a5fb7d93585a051c9b0ca694}{cx\_total}());
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em C\+O\+N\+T\+E\+X\+T-\/\+E\+R\+R\+OR} & this exception is thrown if called without an active \hyperlink{statements_context}{context statement}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\mbox{\Hypertarget{group__context__functions_ga105b00b74b4fba117cbf3582d1ad7363}\label{group__context__functions_ga105b00b74b4fba117cbf3582d1ad7363}} 
\index{Context Functions@{Context Functions}!cx\+\_\+value@{cx\+\_\+value}}
\index{cx\+\_\+value@{cx\+\_\+value}!Context Functions@{Context Functions}}
\subsubsection{\texorpdfstring{cx\+\_\+value()}{cx\_value()}}
{\footnotesize\ttfamily auto Qore\+::cx\+\_\+value (\begin{DoxyParamCaption}\item[{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}]{key }\end{DoxyParamCaption})}



Returns the current value of the given column while iterating a \hyperlink{statements_context}{context statement}. 

\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em key} & the column name to return the value for\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the current value of the given column while iterating a \hyperlink{statements_context}{context statement}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
context (ds.select(sql)) \{
    auto val = \hyperlink{group__context__functions_ga105b00b74b4fba117cbf3582d1ad7363}{cx\_value}(\textcolor{stringliteral}{"column1"});
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em C\+O\+N\+T\+E\+X\+T-\/\+E\+R\+R\+OR} & this exception is thrown if called without an active \hyperlink{statements_context}{context statement} \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the \hyperlink{character_encoding_default_encoding}{default character encoding}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
