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


\doxysubsection{Detailed Description}


\doxysubsection{Function Documentation}
\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}}
\doxysubsubsection{\texorpdfstring{cx\_first()}{cx\_first()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::cx\+\_\+first (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

\begin{DoxyReturn}{Returns}
\doxysectlink{basic_data_types_True}{True}{2} if currently iterating the first element in a \doxysectlink{statements_context}{context statement}{1}, \doxysectlink{basic_data_types_False}{False}{2} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em CONTEXT-\/\+ERROR} & this exception is thrown if called without an active \doxysectlink{statements_context}{context statement}{1}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\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}}
\doxysubsubsection{\texorpdfstring{cx\_last()}{cx\_last()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} Qore\+::cx\+\_\+last (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

\begin{DoxyReturn}{Returns}
\doxysectlink{basic_data_types_True}{True}{2} if currently iterating the last element in a \doxysectlink{statements_context}{context statement}{1}, \doxysectlink{basic_data_types_False}{False}{2} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em CONTEXT-\/\+ERROR} & this exception is thrown if called without an active \doxysectlink{statements_context}{context statement}{1}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\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}}
\doxysubsubsection{\texorpdfstring{cx\_pos()}{cx\_pos()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::cx\+\_\+pos (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

\begin{DoxyReturn}{Returns}
the current row number within the active \doxysectlink{statements_context}{context statement}{1} (starting from 0)
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em CONTEXT-\/\+ERROR} & this exception is thrown if called without an active \doxysectlink{statements_context}{context statement}{1}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\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}}
\doxysubsubsection{\texorpdfstring{cx\_total()}{cx\_total()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::cx\+\_\+total (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

\begin{DoxyReturn}{Returns}
the total number of rows within the active \doxysectlink{statements_context}{context statement}{1}
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em CONTEXT-\/\+ERROR} & this exception is thrown if called without an active \doxysectlink{statements_context}{context statement}{1}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
\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}}
\doxysubsubsection{\texorpdfstring{cx\_value()}{cx\_value()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} Qore\+::cx\+\_\+value (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{key }\end{DoxyParamCaption})}



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

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}{1}
\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 \doxysectlink{statements_context}{context statement}{1}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em CONTEXT-\/\+ERROR} & this exception is thrown if called without an active \doxysectlink{statements_context}{context statement}{1} \\
\hline
{\em ENCODING-\/\+CONVERSION-\/\+ERROR} & the given string could not be converted to the \doxysectlink{character_encoding_default_encoding}{default character encoding}{1}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
