\hypertarget{group__context__functions}{}\doxysection{Context Functions}
\label{group__context__functions}\index{Context Functions@{Context Functions}}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
bool \mbox{\hyperlink{group__context__functions_gaf0dfc0d47bd06a2c1a6e76e3381f61eb}{Qore\+::cx\+\_\+first}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} if currently iterating the first element in a \mbox{\hyperlink{statements_context}{context statement}}, \mbox{\hyperlink{basic_data_types_False}{False}} if not. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{group__context__functions_gad5b21ea6273b824301e13be824205957}{Qore\+::cx\+\_\+last}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} if currently iterating the last element in a \mbox{\hyperlink{statements_context}{context statement}}, \mbox{\hyperlink{basic_data_types_False}{False}} 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 \mbox{\hyperlink{statements_context}{context statement}} (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 \mbox{\hyperlink{statements_context}{context statement}}. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{group__context__functions_ga105b00b74b4fba117cbf3582d1ad7363}{Qore\+::cx\+\_\+value}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} key)
\begin{DoxyCompactList}\small\item\em Returns the current value of the given column while iterating a \mbox{\hyperlink{statements_context}{context statement}}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


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



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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{context (ds.select(sql)) \{}
\DoxyCodeLine{    \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__context__functions_gaf0dfc0d47bd06a2c1a6e76e3381f61eb}{cx\_first}}())}
\DoxyCodeLine{        \mbox{\hyperlink{group__string__functions_ga996c5d1686fbc245f0bc7a02012e6a33}{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 \mbox{\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}}
\doxysubsubsection{\texorpdfstring{cx\_last()}{cx\_last()}}
{\footnotesize\ttfamily bool Qore\+::cx\+\_\+last (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{context (ds.select(sql)) \{}
\DoxyCodeLine{    \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__context__functions_gad5b21ea6273b824301e13be824205957}{cx\_last}}())}
\DoxyCodeLine{        \mbox{\hyperlink{group__string__functions_ga996c5d1686fbc245f0bc7a02012e6a33}{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 \mbox{\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}}
\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 \mbox{\hyperlink{statements_context}{context statement}} (starting from 0) 

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

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

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em CONTEXT-\/\+ERROR} & this exception is thrown if called without an active \mbox{\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}}
\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 \mbox{\hyperlink{statements_context}{context statement}}. 

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

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

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em CONTEXT-\/\+ERROR} & this exception is thrown if called without an active \mbox{\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}}
\doxysubsubsection{\texorpdfstring{cx\_value()}{cx\_value()}}
{\footnotesize\ttfamily 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 \mbox{\hyperlink{statements_context}{context statement}}. 

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

\begin{DoxyCode}{0}
\DoxyCodeLine{context (ds.select(sql)) \{}
\DoxyCodeLine{    auto val = \mbox{\hyperlink{group__context__functions_ga105b00b74b4fba117cbf3582d1ad7363}{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 \mbox{\hyperlink{statements_context}{context statement}} \\
\hline
{\em ENCODING-\/\+CONVERSION-\/\+ERROR} & the given string could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+4 
\end{DoxySince}
