\hypertarget{class_qore_1_1_program}{}\section{Qore\+::Program Class Reference}
\label{class_qore_1_1_program}\index{Qore::Program@{Qore::Program}}


\mbox{\hyperlink{class_qore_1_1_program}{Program}} objects allow Qore programs to support subprograms with the option to restrict capabilities, for example, to support user-\/defined logic for application actions.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
auto \mbox{\hyperlink{class_qore_1_1_program_ac89b5d0d7eb6ead64ee969b985473510}{call\+Function}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name,...)
\begin{DoxyCompactList}\small\item\em Calls a function in the program object and returns the return value. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{class_qore_1_1_program_afe079c4f8df163b528a64391812b3ee7}{call\+Function\+Args}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Calls a function in the program object giving the arguments to the function as a list and returns the return value. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a3b1e638a11c6cf53e9c2b5dfd325decc}{constructor}} (softint po=\mbox{\hyperlink{group__parse__options_gaf8ee107760d23b03c6db359c872cc0f9}{P\+O\+\_\+\+D\+E\+F\+A\+U\+LT}})
\begin{DoxyCompactList}\small\item\em Creates the program object and optionally sets program capabilities (\mbox{\hyperlink{group__parse__options}{parse options}}) \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a0f2f5aaf174d9d34c6702cb32e4c0392}{copy}} ()
\begin{DoxyCompactList}\small\item\em Throws an exception to prevent objects of this class from being copied. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_aaca64251d8972c9dab39c3fa6782f0af}{define}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} def, auto val)
\begin{DoxyCompactList}\small\item\em Sets a \mbox{\hyperlink{conditional_parsing}{parse define}} for the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_qore_1_1_program_ae4c5fd96efea7bc6015f5ad170c5eafa}\label{class_qore_1_1_program_ae4c5fd96efea7bc6015f5ad170c5eafa}} 
\mbox{\hyperlink{class_qore_1_1_program_ae4c5fd96efea7bc6015f5ad170c5eafa}{destructor}} ()
\begin{DoxyCompactList}\small\item\em Waits for all threads to finish executing, then deletes all global variables, dereferences the internal \mbox{\hyperlink{class_qore_1_1_program}{Program}} object and deletes the Qore object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a1f1e259bc987a7e4627e3ac2cc0c96b5}{disable\+Parse\+Options}} (softint opt)
\begin{DoxyCompactList}\small\item\em Removes the given parse options to the current parse option mask. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_program_abefc819b0a8654efc1174971e06e8c5a}{exists\+Function}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name)
\begin{DoxyCompactList}\small\item\em Checks if a user function exists in the program object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ $>$ \mbox{\hyperlink{class_qore_1_1_program_a5ddd01615f5ef8124c4351fd37616f8c}{find\+Function\+Variants}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} function)
\begin{DoxyCompactList}\small\item\em finds all variants of a function or class method and returns a list of the results \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{class_qore_1_1_program_ae9ed01da361e88222eb447491e4cf91e}{get\+All\+Defines}} ()
\begin{DoxyCompactList}\small\item\em Retrieves all \mbox{\hyperlink{conditional_parsing}{parse defines}} in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{class_qore_1_1_program_a82ba5819f483199901331e27908c9749}{get\+Define}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} def)
\begin{DoxyCompactList}\small\item\em Retrieves the value of the given \mbox{\hyperlink{conditional_parsing}{parse define}} in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{class_qore_1_1_program_a060d0ab426b9ce6a5a8aeaf59010afa0}{get\+Global\+Variable}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} varname, \+\_\+\+\_\+7\+\_\+ reference$<$ bool $>$ rexists)
\begin{DoxyCompactList}\small\item\em Returns a the value of the global variable identified by the first string argument. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{class_qore_1_1_program_af850abe615e1fac34dae8e4fc9efc1f2}{get\+Global\+Vars}} ()
\begin{DoxyCompactList}\small\item\em returns a hash of global variables \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ \mbox{\hyperlink{class_qore_1_1_program_aee25b65b811efa96f8d3690c0d19314e}{get\+Parse\+Option\+String\+List}} ()
\begin{DoxyCompactList}\small\item\em returns a list of parse option strings for the program object \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_program_a3d866874a2a1935fd30554217e01234e}{get\+Parse\+Options}} ()
\begin{DoxyCompactList}\small\item\em Returns the current binary-\/or\textquotesingle{}ed parse option mask for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_control}{Program\+Control}} \mbox{\hyperlink{class_qore_1_1_program_ac6452df864cbfbc4c6b72d0bfe9ebdd0}{get\+Program}} ()
\begin{DoxyCompactList}\small\item\em Get \mbox{\hyperlink{class_qore_1_1_program_control}{Program\+Control}}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_program_a97df6d56c39b48b1aac5404c163cff61}{get\+Program\+Id}} ()
\begin{DoxyCompactList}\small\item\em Get program id. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_program_a8d96549d48cf1707054dc48f5bde4004}{get\+Script\+Dir}} ()
\begin{DoxyCompactList}\small\item\em Returns the current script directory as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if not set. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_program_a1dc1b0f848a30ec2d06fbafe7fcd677d}{get\+Script\+Name}} ()
\begin{DoxyCompactList}\small\item\em Returns the current script name as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if not set. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_program_aeabcc63c1d60f6efd6878bbb658a3be5}{get\+Script\+Path}} ()
\begin{DoxyCompactList}\small\item\em Returns the current script directory and filename if known, otherwise returns \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} $>$ \mbox{\hyperlink{class_qore_1_1_program_a5435e046150b69d97f215c0f6b192ce0}{get\+Thread\+List}} ()
\begin{DoxyCompactList}\small\item\em returns a list of thread I\+Ds active in this \mbox{\hyperlink{class_qore_1_1_program}{Program}} \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} \mbox{\hyperlink{class_qore_1_1_program_a8d3e26434c9defc264c31d5f5f08d3ba}{get\+Time\+Zone}} ()
\begin{DoxyCompactList}\small\item\em Returns the default local time zone for the object. \end{DoxyCompactList}\item 
softlist$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ \mbox{\hyperlink{class_qore_1_1_program_a602d27acca6b0792205c4cdb1677e63d}{get\+User\+Function\+List}} ()
\begin{DoxyCompactList}\small\item\em Returns a list of strings of all user functions defined in the program object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_abf634534cb29157d05aab5ff3ffd6bea}{import\+Class}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} cls, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} new\+\_\+name, \+\_\+\+\_\+7\+\_\+ softbool inject, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} module\+\_\+visibility=\mbox{\hyperlink{group__import__visibility__constants_gac013431f5fa7cc6e8d4e3ac4edd090f6}{C\+S\+P\+\_\+\+U\+N\+C\+H\+A\+N\+G\+ED}})
\begin{DoxyCompactList}\small\item\em Imports a class into the program object\textquotesingle{}s space; any calls to the imported class\textquotesingle{}s code will run with the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\textquotesingle{}s permissions. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a9a2e3da4029c50643169cbb72e57f494}{import\+Function}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} func)
\begin{DoxyCompactList}\small\item\em Imports a function into the program object\textquotesingle{}s space; any calls to the imported function will run with the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\textquotesingle{}s permissions. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a4ea59c8d245e924b791a74cdb551946f}{import\+Function}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} func, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} new\+\_\+name, \+\_\+\+\_\+7\+\_\+ softbool inject)
\begin{DoxyCompactList}\small\item\em Imports a function into the program object\textquotesingle{}s space and gives it a new name; any calls to the imported function will run with the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\textquotesingle{}s permissions. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a5db34046e2722a8519642ad98f412ed3}{import\+Global\+Variable}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} varname, bool readonly=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}})
\begin{DoxyCompactList}\small\item\em Imports a global variable into the program object\textquotesingle{}s space. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a029c9dbdbdc3dc13e685f7d101e5829e}{import\+Hash\+Decl}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} new\+\_\+name)
\begin{DoxyCompactList}\small\item\em Imports a \mbox{\hyperlink{hashdecl}{typed hash declaration}} into the program object\textquotesingle{}s space. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a8abea6fe89712e9b4f84c7f7b0420151}{import\+System\+Api}} ()
\begin{DoxyCompactList}\small\item\em imports system classes and functions into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_ga52d1e7bd71353fe0b0669e9f5a078206}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+F\+U\+N\+C\+\_\+\+V\+A\+R\+I\+A\+N\+TS}}, \mbox{\hyperlink{group__parse__options_gaa3d360ed4159338ebbeee314914cb912}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+H\+A\+S\+H\+D\+E\+C\+LS}}, \mbox{\hyperlink{group__parse__options_gaec5488ae61db4b43af0e89ddc532e379}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+O\+N\+S\+T\+A\+N\+TS}}, and \mbox{\hyperlink{group__parse__options_gaedeb6f38e275c56932618969f60384ff}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+L\+A\+S\+S\+ES}} \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_ad512b5c0b491823d186e0de7cf8d87d4}{import\+System\+Classes}} ()
\begin{DoxyCompactList}\small\item\em imports system classes into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_gaedeb6f38e275c56932618969f60384ff}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+L\+A\+S\+S\+ES}} \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a2942f186ac759fb7a71cbb9ec0ffb72a}{import\+System\+Constants}} ()
\begin{DoxyCompactList}\small\item\em imports system constants into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_gaec5488ae61db4b43af0e89ddc532e379}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+O\+N\+S\+T\+A\+N\+TS}} \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_adc115cc0b1c0f196ed0d764eb33c4009}{import\+System\+Functions}} ()
\begin{DoxyCompactList}\small\item\em imports system functions into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_ga52d1e7bd71353fe0b0669e9f5a078206}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+F\+U\+N\+C\+\_\+\+V\+A\+R\+I\+A\+N\+TS}} \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a4aef71f37e505dbe84be95b0a2848cba}{import\+System\+Hash\+Decls}} ()
\begin{DoxyCompactList}\small\item\em imports system hashdecls into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_gaa3d360ed4159338ebbeee314914cb912}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+H\+A\+S\+H\+D\+E\+C\+LS}} \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_program_afcfa159016f0f76d7a1abdf8e3895b6b}{is\+Defined}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} def)
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the given \mbox{\hyperlink{conditional_parsing}{parse define}} is defined in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} (does not have to have a value defined to return \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}), \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_afe6fc6b4013b8e2ff209ac9dad421487}{issue\+Module\+Cmd}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} module, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} cmd)
\begin{DoxyCompactList}\small\item\em issues a module command for the given module; the module is loaded into the current Program object if it is not already present \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{load\+Apply\+To\+Private\+User\+Module}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore user module privately into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{load\+Apply\+To\+Private\+User\+Module\+Warn}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore user module privately into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{load\+Apply\+To\+User\+Module}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \+\_\+\+\_\+7\+\_\+ softbool reinject, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore user module into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{load\+Apply\+To\+User\+Module\+Warn}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \+\_\+\+\_\+7\+\_\+ softbool reinject, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore user module into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{load\+Module}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{load\+Module\+Warn}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{load\+User\+Module\+With\+Program}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \mbox{\hyperlink{class_qore_1_1_program}{Qore\+::\+Program}} pgm, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore user module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time using the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} object as the container for the user module code. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{load\+User\+Module\+With\+Program\+Warn}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, \mbox{\hyperlink{class_qore_1_1_program}{Qore\+::\+Program}} pgm, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask=\mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}})
\begin{DoxyCompactList}\small\item\em Loads a Qore user module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time using the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} object as the container for the user module code. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_ae3548963216fe5426a7dad63c20afb59}{lock\+Options}} ()
\begin{DoxyCompactList}\small\item\em Locks parse options so that they cannot be changed. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{parse}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} code, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} label, \+\_\+\+\_\+7\+\_\+ softint warning\+\_\+mask, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} source, \+\_\+\+\_\+7\+\_\+ softint offset, softbool format\+\_\+label=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Parses the string argument and adds the code to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{parse\+Commit}} ()
\begin{DoxyCompactList}\small\item\em Commits and pending code processed with \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}} to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object after resolving all outstanding references in the pending code. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_program_a444d96ebbcec2384058ce44b78198d17}{parse\+Commit}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+mask)
\begin{DoxyCompactList}\small\item\em Commits and pending code processed with \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}} to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object after resolving all outstanding references in the pending code. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} $>$ \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{parse\+Pending}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} code, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} label, \+\_\+\+\_\+7\+\_\+ softint warning\+\_\+mask, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} source, \+\_\+\+\_\+7\+\_\+ softint offset, softbool format\+\_\+label=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Parses the text passed to pending lists in the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; does not resolve all references or commit the code to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}{parse\+Rollback}} ()
\begin{DoxyCompactList}\small\item\em Removes all partially or fully-\/parsed code from the object along with other builtin objects; a Program object is not usable after calling this method; do not use this method but instead destroy the Program object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a2d1d26dcb43d846cec1ecf926115b857}{replace\+Parse\+Options}} (softint opt)
\begin{DoxyCompactList}\small\item\em Replaces the parse options for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{class_qore_1_1_program_a6b2c023e8c1d81279ef8320f5901d5e3}{run}} ()
\begin{DoxyCompactList}\small\item\em Runs the program and optionally returns a value if the top-\/level code exits with a \mbox{\hyperlink{statements_return}{return statement.}}\end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a8be97bfcd125d83a9415c843694734ac}{set\+Global\+Var\+Value}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} name, auto value)
\begin{DoxyCompactList}\small\item\em set the value of a global variable \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a046e332aac8933c562fef80cd5abf0cb}{set\+Parse\+Options}} (softint opt=\mbox{\hyperlink{group__parse__options_gaf8ee107760d23b03c6db359c872cc0f9}{P\+O\+\_\+\+D\+E\+F\+A\+U\+LT}})
\begin{DoxyCompactList}\small\item\em Sets parse options in the parse option mask for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a8def65d25a0934417aa425c84f38b568}{set\+Script\+Path}} (\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path)
\begin{DoxyCompactList}\small\item\em Sets (or clears) the script path (directory and filename) for the object. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_program_a6fda138e987e698d3c5b11294d21bcdb}{set\+Thread\+Init}} (\+\_\+\+\_\+7\+\_\+ code init)
\begin{DoxyCompactList}\small\item\em Sets a \mbox{\hyperlink{expressions_call_reference}{call reference}} or \mbox{\hyperlink{expressions_closure}{closure}} to run every time a new thread is started. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a8dc5c5f1315c9b0faebf9806548d30b2}{set\+Time\+Zone}} (\mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} zone)
\begin{DoxyCompactList}\small\item\em Sets the default local time zone for the object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a5eaa38aba68af2d1884cf014d8c7c0aa}{set\+Time\+Zone\+Region}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} region)
\begin{DoxyCompactList}\small\item\em Sets the default local time zone for the object from a path to a zoneinfo time zone region file. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_aa210b78ad95860ecc26d4489d276d180}{set\+Time\+Zone\+U\+T\+C\+Offset}} (softint seconds\+\_\+east)
\begin{DoxyCompactList}\small\item\em Sets the default time zone for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object based on the number of seconds east of U\+TC; for zones west of U\+TC, use negative numbers. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_program_a275563ed4d95be6a9900d2966025802c}{undefine}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} def)
\begin{DoxyCompactList}\small\item\em Unsets a \mbox{\hyperlink{conditional_parsing}{parse define}} for the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\mbox{\hyperlink{class_qore_1_1_program}{Program}} objects allow Qore programs to support subprograms with the option to restrict capabilities, for example, to support user-\/defined logic for application actions. 

Parsing in Qore happens in two steps; first all code is parsed to pending data structures, and then in the second stage, all references are resolved, and, if there are no errors, then all changes are committed to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. Note that all parse actions (\mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Program\+::parse()}}, \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}}, \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}}, and \mbox{\hyperlink{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}{Program\+::parse\+Rollback()}}) are atomic; there is a thread lock on each \mbox{\hyperlink{class_qore_1_1_program}{Program}} object to ensure atomicity, and if any parse errors occur in any stage of parsing, any pending changes to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object are automatically rolled back. However parse actions that affect only one stage of the two stages of parsing (\mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}}, \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}} and \mbox{\hyperlink{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}{Program\+::parse\+Rollback()}}) are atomic within themselves, but not between calls, so one thread may inadvertently commit changes to a \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if two or more threads are trying to perform transaction-\/safe two-\/stage parsing on a \mbox{\hyperlink{class_qore_1_1_program}{Program}} object without explicit user locking.

A complete parse action (\mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Program\+::parse()}} or \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}}) can only be performed once; subsequent attempts to parse code into the same Program object will fail with an exception. If parsing fails due to a parse exception, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is generally no longer usable and must be recreated to be used.

\mbox{\hyperlink{group__parse__options}{Parse option constants}} can be used to limit the capabilities of a \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. These options should be binary-\/\+OR\textquotesingle{}ed together and passed to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\textquotesingle{}s constructor. Also see \mbox{\hyperlink{command_line_processing}{qore Executable Command-\/\+Line Processing}} for equivalent command-\/line options, and \mbox{\hyperlink{parse_directives}{Parse Directives}} for equivalent parse directives.

Note that a program can provide controlled access to functionality otherwise restricted by parse options by exporting a custom A\+PI into the child program object using either the \mbox{\hyperlink{class_qore_1_1_program_a9a2e3da4029c50643169cbb72e57f494}{Program\+::import\+Function()}} or \mbox{\hyperlink{class_qore_1_1_program_a5db34046e2722a8519642ad98f412ed3}{Program\+::import\+Global\+Variable()}} method. This is possible because code (functions or object methods) imported into and called from a subprogram will run in the parent\textquotesingle{}s space and therefore with the parent\textquotesingle{}s capabilities.

\mbox{\hyperlink{qore_classes}{Classes}}, \mbox{\hyperlink{constants}{constants}}, \mbox{\hyperlink{qore_namespaces}{namespaces}}, \mbox{\hyperlink{qore_functions}{functions}}, and \mbox{\hyperlink{variables_global_variables}{global variables}} are only inherited into child \mbox{\hyperlink{class_qore_1_1_program}{Program}} objects if they are declared \mbox{\hyperlink{qore_modules_mod_public}{public}} and no \mbox{\hyperlink{group__parse__options}{parse options}} prohibit it.

Symbols can also be imported into \mbox{\hyperlink{class_qore_1_1_program}{Program}} objects singly using methods such as \mbox{\hyperlink{class_qore_1_1_program_abf634534cb29157d05aab5ff3ffd6bea}{Program\+::import\+Class()}} and \mbox{\hyperlink{class_qore_1_1_program_a5db34046e2722a8519642ad98f412ed3}{Program\+::import\+Global\+Variable()}}, etc. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_program_ac89b5d0d7eb6ead64ee969b985473510}\label{class_qore_1_1_program_ac89b5d0d7eb6ead64ee969b985473510}} 
\index{Qore::Program@{Qore::Program}!callFunction@{callFunction}}
\index{callFunction@{callFunction}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{callFunction()}{callFunction()}}
{\footnotesize\ttfamily auto Qore\+::\+Program\+::call\+Function (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{}]{... }\end{DoxyParamCaption})}



Calls a function in the program object and returns the return value. 

The function runs with the permissions of the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object containing the function.


\begin{DoxyParams}{Parameters}
{\em name} & The name of the function to call \\
\hline
{\em ...} & The remaining arguments passed to the method are passed to the function to be called\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Depends on the function being called
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{auto result = pgm.callFunction(\textcolor{stringliteral}{"func\_name"}, arg1, arg2);}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+N\+V\+A\+L\+I\+D-\/\+F\+U\+N\+C\+T\+I\+O\+N-\/\+A\+C\+C\+E\+SS} & \mbox{\hyperlink{group__parse__options}{Parse options}} do not allow this builtin function to be called \\
\hline
{\em N\+O-\/\+F\+U\+N\+C\+T\+I\+ON} & The function does not exist \\
\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 function name could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
The function called could also cause other exceptions to be thrown 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_program_afe079c4f8df163b528a64391812b3ee7}\label{class_qore_1_1_program_afe079c4f8df163b528a64391812b3ee7}} 
\index{Qore::Program@{Qore::Program}!callFunctionArgs@{callFunctionArgs}}
\index{callFunctionArgs@{callFunctionArgs}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{callFunctionArgs()}{callFunctionArgs()}}
{\footnotesize\ttfamily auto Qore\+::\+Program\+::call\+Function\+Args (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})}



Calls a function in the program object giving the arguments to the function as a list and returns the return value. 

The function runs with the permissions of the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object containing the function.


\begin{DoxyParams}{Parameters}
{\em name} & The name of the function to call \\
\hline
{\em vargs} & The arguments to the function to be called\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Depends on the function being called
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{auto result = pgm.callFunctionArgs(\textcolor{stringliteral}{"func\_name"}, (arg1, arg2));}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+N\+V\+A\+L\+I\+D-\/\+F\+U\+N\+C\+T\+I\+O\+N-\/\+A\+C\+C\+E\+SS} & \mbox{\hyperlink{group__parse__options}{Parse options}} do not allow this builtin function to be called \\
\hline
{\em N\+O-\/\+F\+U\+N\+C\+T\+I\+ON} & The function does not exist \\
\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 function name could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
The function called could also cause other exceptions to be thrown 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_program_a3b1e638a11c6cf53e9c2b5dfd325decc}\label{class_qore_1_1_program_a3b1e638a11c6cf53e9c2b5dfd325decc}} 
\index{Qore::Program@{Qore::Program}!constructor@{constructor}}
\index{constructor@{constructor}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::constructor (\begin{DoxyParamCaption}\item[{softint}]{po = {\ttfamily \mbox{\hyperlink{group__parse__options_gaf8ee107760d23b03c6db359c872cc0f9}{P\+O\+\_\+\+D\+E\+F\+A\+U\+LT}}} }\end{DoxyParamCaption})}



Creates the program object and optionally sets program capabilities (\mbox{\hyperlink{group__parse__options}{parse options}}) 

Note that if \mbox{\hyperlink{group__parse__options_gaa567ec1170360b9ca111402c5179109f}{P\+O\+\_\+\+N\+O\+\_\+\+C\+H\+I\+L\+D\+\_\+\+P\+O\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+I\+O\+NS}} is not set in the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} when the new \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is created, then the created \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will have the parent\textquotesingle{}s parse options added to its parse options as given by the argument to the constructor.

In other words, if \mbox{\hyperlink{group__parse__options_gaa567ec1170360b9ca111402c5179109f}{P\+O\+\_\+\+N\+O\+\_\+\+C\+H\+I\+L\+D\+\_\+\+P\+O\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+I\+O\+NS}} is not set, it\textquotesingle{}s not possible to create a child \mbox{\hyperlink{class_qore_1_1_program}{Program}} object with fewer restrictions than the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object (any attempt to do so will be silently ignored).

However, if \mbox{\hyperlink{group__parse__options_gaa567ec1170360b9ca111402c5179109f}{P\+O\+\_\+\+N\+O\+\_\+\+C\+H\+I\+L\+D\+\_\+\+P\+O\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+I\+O\+NS}} is set in the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object, then the parse option argument to the constructor will be applied literally to the child object.

\mbox{\hyperlink{class_qore_1_1_program_control}{Program\+Control}} provides internal \mbox{\hyperlink{class_qore_1_1_program}{Program}} data for debugging purposes.

Use the \mbox{\hyperlink{class_qore_1_1_program_control_a78bd0f7dcf619ef86f761f602538d43a}{Program\+Control\+::get\+Program()}} method to attach to the currently running program

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gab1337f461ab4a90df9b39a7f1b6cc2b0}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+E\+M\+B\+E\+D\+D\+E\+D\+\_\+\+L\+O\+G\+IC}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em po} & A binary OR\textquotesingle{}ed product of \mbox{\hyperlink{group__parse__options}{parse options}}\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Program pgm();}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+O\+P\+T\+I\+O\+N-\/\+E\+R\+R\+OR} & invalid parse options used \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_program_a0f2f5aaf174d9d34c6702cb32e4c0392}\label{class_qore_1_1_program_a0f2f5aaf174d9d34c6702cb32e4c0392}} 
\index{Qore::Program@{Qore::Program}!copy@{copy}}
\index{copy@{copy}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Throws an exception to prevent objects of this class from being copied. 


\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+C\+O\+P\+Y-\/\+E\+R\+R\+OR} & copying \mbox{\hyperlink{class_qore_1_1_program}{Program}} objects is currently unsupported \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_program_aaca64251d8972c9dab39c3fa6782f0af}\label{class_qore_1_1_program_aaca64251d8972c9dab39c3fa6782f0af}} 
\index{Qore::Program@{Qore::Program}!define@{define}}
\index{define@{define}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{define()}{define()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::define (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{def,  }\item[{auto}]{val }\end{DoxyParamCaption})}



Sets a \mbox{\hyperlink{conditional_parsing}{parse define}} for the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. 


\begin{DoxyParams}{Parameters}
{\em def} & The parse define to assign \\
\hline
{\em val} & The value to assign to the define\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.define(\textcolor{stringliteral}{"PRODUCTION"}, \textcolor{keyword}{True});}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_a1f1e259bc987a7e4627e3ac2cc0c96b5}\label{class_qore_1_1_program_a1f1e259bc987a7e4627e3ac2cc0c96b5}} 
\index{Qore::Program@{Qore::Program}!disableParseOptions@{disableParseOptions}}
\index{disableParseOptions@{disableParseOptions}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{disableParseOptions()}{disableParseOptions()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::disable\+Parse\+Options (\begin{DoxyParamCaption}\item[{softint}]{opt }\end{DoxyParamCaption})}



Removes the given parse options to the current parse option mask. 

An {\ttfamily O\+P\+T\+I\+O\+N\+S-\/\+L\+O\+C\+K\+ED} exception is thrown if parse options have been locked (for example with \mbox{\hyperlink{class_qore_1_1_program_ae3548963216fe5426a7dad63c20afb59}{Program\+::lock\+Options()}})


\begin{DoxyParams}{Parameters}
{\em opt} & A single \mbox{\hyperlink{group__parse__options}{parse option}} or binary-\/or\textquotesingle{}ed combination of \mbox{\hyperlink{group__parse__options}{parse options}} to unset in the parse option mask for the object; any bit set in this argument will be unset (ie zeroed out or combined with inverse binary and) in the \mbox{\hyperlink{class_qore_1_1_program}{Program}}\textquotesingle{}s parse option mask\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{\# allow threading and GUI operations}}
\DoxyCodeLine{pgm.disableParseOptions(PO\_NO\_THREADS | PO\_NO\_GUI);}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em O\+P\+T\+I\+O\+N\+S-\/\+L\+O\+C\+K\+ED} & Parse options have been locked and cannot be changed \\
\hline
{\em P\+R\+O\+G\+R\+A\+M-\/\+O\+P\+T\+I\+O\+N-\/\+E\+R\+R\+OR} & invalid parse options used\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_program_a046e332aac8933c562fef80cd5abf0cb}{Program\+::set\+Parse\+Options()}} for a reciprocal method that enables \mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{parse}} options; also see \mbox{\hyperlink{class_qore_1_1_program_a2d1d26dcb43d846cec1ecf926115b857}{Program\+::replace\+Parse\+Options()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_program_abefc819b0a8654efc1174971e06e8c5a}\label{class_qore_1_1_program_abefc819b0a8654efc1174971e06e8c5a}} 
\index{Qore::Program@{Qore::Program}!existsFunction@{existsFunction}}
\index{existsFunction@{existsFunction}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{existsFunction()}{existsFunction()}}
{\footnotesize\ttfamily bool Qore\+::\+Program\+::exists\+Function (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name }\end{DoxyParamCaption})}



Checks if a user function exists in the program object. 

\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{DoxyParams}{Parameters}
{\em name} & The name of the function to check\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the function exists, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if} (pgm.existsFunction(\textcolor{stringliteral}{"my\_func"}))}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"my\_func() exists in the Program\(\backslash\)n"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the function name could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}} \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_program_a5ddd01615f5ef8124c4351fd37616f8c}\label{class_qore_1_1_program_a5ddd01615f5ef8124c4351fd37616f8c}} 
\index{Qore::Program@{Qore::Program}!findFunctionVariants@{findFunctionVariants}}
\index{findFunctionVariants@{findFunctionVariants}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{findFunctionVariants()}{findFunctionVariants()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ $>$ Qore\+::\+Program\+::find\+Function\+Variants (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{function }\end{DoxyParamCaption})}



finds all variants of a function or class method and returns a list of the results 


\begin{DoxyParams}{Parameters}
{\em function} & the function or class method name; may also be namespace-\/justified\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a list of hashes for each resolved name; when matched, each hash element has the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily desc\+:} a string description of the call which includes the name and the full text call signature
\item {\ttfamily params\+:} a Qore\+List\+Node object that gives the params in a format that can be used by \mbox{\hyperlink{class_qore_1_1_program_control_abeb009c4ccc44659d90584bff3e8ff4b}{Program\+Control\+::find\+Function\+Statement\+Id}}
\end{DoxyItemize}
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+E\+R\+R\+OR} & thrown if the function cannot be found\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13
\end{DoxySince}
\begin{DoxyNote}{Note}
the reflection module supercedes this functionality 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_program_ae9ed01da361e88222eb447491e4cf91e}\label{class_qore_1_1_program_ae9ed01da361e88222eb447491e4cf91e}} 
\index{Qore::Program@{Qore::Program}!getAllDefines@{getAllDefines}}
\index{getAllDefines@{getAllDefines}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getAllDefines()}{getAllDefines()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::\+Program\+::get\+All\+Defines (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Retrieves all \mbox{\hyperlink{conditional_parsing}{parse defines}} in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. 

\begin{DoxyReturn}{Returns}
the hash of values of all \mbox{\hyperlink{conditional_parsing}{parse defines}} in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*hash<auto> val = pgm.getAllDefines();}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
A parse define may be defined with no value then values may have nothing values
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a82ba5819f483199901331e27908c9749}\label{class_qore_1_1_program_a82ba5819f483199901331e27908c9749}} 
\index{Qore::Program@{Qore::Program}!getDefine@{getDefine}}
\index{getDefine@{getDefine}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getDefine()}{getDefine()}}
{\footnotesize\ttfamily auto Qore\+::\+Program\+::get\+Define (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{def }\end{DoxyParamCaption})}



Retrieves the value of the given \mbox{\hyperlink{conditional_parsing}{parse define}} in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. 

\begin{DoxyReturn}{Returns}
the value of the given \mbox{\hyperlink{conditional_parsing}{parse define}} in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}
\end{DoxyReturn}
\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}{0}
\DoxyCodeLine{auto val = pgm.getDefine(\textcolor{stringliteral}{"PRODUCTION"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & this error is thrown if the string cannot be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
A parse define may be defined with no value; use \mbox{\hyperlink{class_qore_1_1_program_afcfa159016f0f76d7a1abdf8e3895b6b}{Program\+::is\+Defined()}} to check if a parse define is actually defined or not 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_program_a060d0ab426b9ce6a5a8aeaf59010afa0}\label{class_qore_1_1_program_a060d0ab426b9ce6a5a8aeaf59010afa0}} 
\index{Qore::Program@{Qore::Program}!getGlobalVariable@{getGlobalVariable}}
\index{getGlobalVariable@{getGlobalVariable}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getGlobalVariable()}{getGlobalVariable()}}
{\footnotesize\ttfamily auto Qore\+::\+Program\+::get\+Global\+Variable (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{varname,  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ bool $>$}]{rexists }\end{DoxyParamCaption})}



Returns a the value of the global variable identified by the first string argument. 


\begin{DoxyParams}{Parameters}
{\em varname} & The string name of the global variable to find, not including the leading {\ttfamily \char`\"{}\$\char`\"{}} character \\
\hline
{\em rexists} & An lvalue reference to a \mbox{\hyperlink{data_type_declarations_bool_type}{bool}} to determine if the global variable exists (because this method could return \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} when the variable exists as well as when it does not)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the value of the global variable identified by the first string argument giving the name of the variable (without any leading {\ttfamily \char`\"{}\$\char`\"{}} symbol)
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool existsv;}
\DoxyCodeLine{auto val = pgm.getGlobalVariable(\textcolor{stringliteral}{"error\_count"}, \(\backslash\)existsv);}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_af850abe615e1fac34dae8e4fc9efc1f2}\label{class_qore_1_1_program_af850abe615e1fac34dae8e4fc9efc1f2}} 
\index{Qore::Program@{Qore::Program}!getGlobalVars@{getGlobalVars}}
\index{getGlobalVars@{getGlobalVars}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getGlobalVars()}{getGlobalVars()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::\+Program\+::get\+Global\+Vars (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns a hash of global variables 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto> h = pgm.getGlobalVars();}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a hash of global variables and their values
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__misc__functions_ga35f238f6343017d7e4736cd2c3007752}{Qore\+::get\+\_\+global\+\_\+vars()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a3d866874a2a1935fd30554217e01234e}\label{class_qore_1_1_program_a3d866874a2a1935fd30554217e01234e}} 
\index{Qore::Program@{Qore::Program}!getParseOptions@{getParseOptions}}
\index{getParseOptions@{getParseOptions}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getParseOptions()}{getParseOptions()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Program\+::get\+Parse\+Options (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current binary-\/or\textquotesingle{}ed parse option mask for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. 

\begin{DoxyReturn}{Returns}
the current binary-\/or\textquotesingle{}ed parse option mask for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int mask = pgm.getParseOptions();}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_aee25b65b811efa96f8d3690c0d19314e}\label{class_qore_1_1_program_aee25b65b811efa96f8d3690c0d19314e}} 
\index{Qore::Program@{Qore::Program}!getParseOptionStringList@{getParseOptionStringList}}
\index{getParseOptionStringList@{getParseOptionStringList}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getParseOptionStringList()}{getParseOptionStringList()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}$>$ Qore\+::\+Program\+::get\+Parse\+Option\+String\+List (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns a list of parse option strings for the program object 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{list<string> l = pgm.getParseOptionStringList();}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a list of parse option strings for the program object
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 0.\+9 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_ac6452df864cbfbc4c6b72d0bfe9ebdd0}\label{class_qore_1_1_program_ac6452df864cbfbc4c6b72d0bfe9ebdd0}} 
\index{Qore::Program@{Qore::Program}!getProgram@{getProgram}}
\index{getProgram@{getProgram}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getProgram()}{getProgram()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_program_control}{Program\+Control}} Qore\+::\+Program\+::get\+Program (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Get \mbox{\hyperlink{class_qore_1_1_program_control}{Program\+Control}}. 

\begin{DoxyParagraph}{Restrictions\+:}
M\+U\+ST H\+A\+VE\+: \mbox{\hyperlink{group__parse__options_gad0d38cd46f08bf4210d4010204269cc9}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+D\+E\+B\+U\+G\+G\+ER}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}} 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_a97df6d56c39b48b1aac5404c163cff61}\label{class_qore_1_1_program_a97df6d56c39b48b1aac5404c163cff61}} 
\index{Qore::Program@{Qore::Program}!getProgramId@{getProgramId}}
\index{getProgramId@{getProgramId}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getProgramId()}{getProgramId()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Program\+::get\+Program\+Id (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Get program id. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_program_a97df6d56c39b48b1aac5404c163cff61}{Program\+::get\+Program\+Id}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a8d96549d48cf1707054dc48f5bde4004}\label{class_qore_1_1_program_a8d96549d48cf1707054dc48f5bde4004}} 
\index{Qore::Program@{Qore::Program}!getScriptDir@{getScriptDir}}
\index{getScriptDir@{getScriptDir}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getScriptDir()}{getScriptDir()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Program\+::get\+Script\+Dir (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current script directory as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if not set. 

Gets the script directory set with \mbox{\hyperlink{class_qore_1_1_program_a8def65d25a0934417aa425c84f38b568}{Program\+::set\+Script\+Path()}}. This is the same value that will be returned in the Qore program code with the \mbox{\hyperlink{group__misc__functions_ga4730f5a695996be26efbfa9760417b1b}{get\+\_\+script\+\_\+dir()}} function if called from within the \mbox{\hyperlink{class_qore_1_1_program}{Program}}.

\begin{DoxyReturn}{Returns}
Returns the current script directory as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if not set; if a string is returned, it should normally include the trailing directory separator character ({\ttfamily \char`\"{}/\char`\"{}} on U\+N\+IX, {\ttfamily \char`\"{}\textbackslash{}\textbackslash{}\char`\"{}} on Windows)
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string dir = pgm.getScriptDir();}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_a1dc1b0f848a30ec2d06fbafe7fcd677d}\label{class_qore_1_1_program_a1dc1b0f848a30ec2d06fbafe7fcd677d}} 
\index{Qore::Program@{Qore::Program}!getScriptName@{getScriptName}}
\index{getScriptName@{getScriptName}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getScriptName()}{getScriptName()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Program\+::get\+Script\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current script name as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if not set. 

Gets the script filename set with \mbox{\hyperlink{class_qore_1_1_program_a8def65d25a0934417aa425c84f38b568}{Program\+::set\+Script\+Path()}}. This is the same value that will be returned in the Qore program code with the \mbox{\hyperlink{group__misc__functions_gade1f45f4d12597822362d920c84695a5}{get\+\_\+script\+\_\+name()}} function if called from within the \mbox{\hyperlink{class_qore_1_1_program}{Program}}.

\begin{DoxyReturn}{Returns}
the current script name as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if not set
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string name = pgm.getScriptName();}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_aeabcc63c1d60f6efd6878bbb658a3be5}\label{class_qore_1_1_program_aeabcc63c1d60f6efd6878bbb658a3be5}} 
\index{Qore::Program@{Qore::Program}!getScriptPath@{getScriptPath}}
\index{getScriptPath@{getScriptPath}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getScriptPath()}{getScriptPath()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Program\+::get\+Script\+Path (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current script directory and filename if known, otherwise returns \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}}. 

Gets the script directory and filename set with \mbox{\hyperlink{class_qore_1_1_program_a8def65d25a0934417aa425c84f38b568}{Program\+::set\+Script\+Path()}}. This is the same value that will be returned in the Qore program code with the \mbox{\hyperlink{group__misc__functions_ga3ebc5d7d350677395e4b89686ca335b4}{get\+\_\+script\+\_\+path()}} function if called from within the \mbox{\hyperlink{class_qore_1_1_program}{Program}}.

\begin{DoxyReturn}{Returns}
the current script directory and filename if known, otherwise returns \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}}
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string path = pgm.getScriptPath();}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_a5435e046150b69d97f215c0f6b192ce0}\label{class_qore_1_1_program_a5435e046150b69d97f215c0f6b192ce0}} 
\index{Qore::Program@{Qore::Program}!getThreadList@{getThreadList}}
\index{getThreadList@{getThreadList}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getThreadList()}{getThreadList()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}$>$ Qore\+::\+Program\+::get\+Thread\+List (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns a list of thread I\+Ds active in this \mbox{\hyperlink{class_qore_1_1_program}{Program}} 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{list<int> l = pgm.getThreadList();}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a list of thread I\+Ds active in this \mbox{\hyperlink{class_qore_1_1_program}{Program}}
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a8d3e26434c9defc264c31d5f5f08d3ba}\label{class_qore_1_1_program_a8d3e26434c9defc264c31d5f5f08d3ba}} 
\index{Qore::Program@{Qore::Program}!getTimeZone@{getTimeZone}}
\index{getTimeZone@{getTimeZone}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getTimeZone()}{getTimeZone()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}} Qore\+::\+Program\+::get\+Time\+Zone (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the default local time zone for the object. 

\begin{DoxyReturn}{Returns}
the default local time zone for the object
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{TimeZone tz = pgm.getTimeZone();}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_a602d27acca6b0792205c4cdb1677e63d}\label{class_qore_1_1_program_a602d27acca6b0792205c4cdb1677e63d}} 
\index{Qore::Program@{Qore::Program}!getUserFunctionList@{getUserFunctionList}}
\index{getUserFunctionList@{getUserFunctionList}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{getUserFunctionList()}{getUserFunctionList()}}
{\footnotesize\ttfamily softlist$<$\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}$>$ Qore\+::\+Program\+::get\+User\+Function\+List (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns a list of strings of all user functions defined in the program object. 

\begin{DoxyReturn}{Returns}
a list of strings of all user functions defined in the program object
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{list<string> l = pgm.getUserFunctionList();}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
the reflection module supercedes this functionality 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_program_abf634534cb29157d05aab5ff3ffd6bea}\label{class_qore_1_1_program_abf634534cb29157d05aab5ff3ffd6bea}} 
\index{Qore::Program@{Qore::Program}!importClass@{importClass}}
\index{importClass@{importClass}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importClass()}{importClass()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::import\+Class (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{cls,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{new\+\_\+name,  }\item[{\+\_\+\+\_\+7\+\_\+ softbool}]{inject,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{module\+\_\+visibility = {\ttfamily \mbox{\hyperlink{group__import__visibility__constants_gac013431f5fa7cc6e8d4e3ac4edd090f6}{C\+S\+P\+\_\+\+U\+N\+C\+H\+A\+N\+G\+ED}}} }\end{DoxyParamCaption})}



Imports a class into the program object\textquotesingle{}s space; any calls to the imported class\textquotesingle{}s code will run with the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\textquotesingle{}s permissions. 

This allows a user-\/defined A\+PI with greater capabilities than the embedded \mbox{\hyperlink{class_qore_1_1_program}{Program}} object to be imported into the embedded code.


\begin{DoxyParams}{Parameters}
{\em cls} & the name of the class to import into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object \\
\hline
{\em new\+\_\+name} & the name of the class in the imported \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; can be a fully-\/qualified namespace path, in which case the namespace path will be created in the target \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if necessary as well (ex\+: {\ttfamily \char`\"{}\+Ns1\+::\+Ns2\+::\+My\+Class\char`\"{}}) \\
\hline
{\em inject} & if \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} then the imported class will be marked as a dependency injection and therefore will not be overritten by subsequent calls to \mbox{\hyperlink{class_qore_1_1_program_ad512b5c0b491823d186e0de7cf8d87d4}{Program\+::import\+System\+Classes()}}, \mbox{\hyperlink{class_qore_1_1_program_a4aef71f37e505dbe84be95b0a2848cba}{Program\+::import\+System\+Hash\+Decls()}}, \mbox{\hyperlink{class_qore_1_1_program_a2942f186ac759fb7a71cbb9ec0ffb72a}{Program\+::import\+System\+Constants()}}, \mbox{\hyperlink{class_qore_1_1_program_a8abea6fe89712e9b4f84c7f7b0420151}{Program\+::import\+System\+Api()}}, \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}, or \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}; note that for this call to succeed, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} must have \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}} set \\
\hline
{\em module\+\_\+visibility} & see \mbox{\hyperlink{group__import__visibility__constants}{Import Visibility Constants}} for valid values\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importClass(\textcolor{stringliteral}{"MyNamespace::MyClass"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em C\+L\+A\+S\+S-\/\+I\+M\+P\+O\+R\+T-\/\+E\+R\+R\+OR} & Cannot import a class into the same \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; class or namespace with this name already exists or the source class does not exist; injection indicated but \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}} not set \\
\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 class name could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item This method was first implemented in Qore 0.\+8.\+7
\item Qore 0.\+8.\+12 added the {\itshape new\+\_\+name} and {\itshape inject} parameters
\item Qore 0.\+9,3 added the {\itshape module\+\_\+visibility} parameter 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a9a2e3da4029c50643169cbb72e57f494}\label{class_qore_1_1_program_a9a2e3da4029c50643169cbb72e57f494}} 
\index{Qore::Program@{Qore::Program}!importFunction@{importFunction}}
\index{importFunction@{importFunction}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importFunction()}{importFunction()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::import\+Function (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{func }\end{DoxyParamCaption})}



Imports a function into the program object\textquotesingle{}s space; any calls to the imported function will run with the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\textquotesingle{}s permissions. 

This allows a user-\/defined A\+PI with greater capabilities than the embedded \mbox{\hyperlink{class_qore_1_1_program}{Program}} object to be imported into the embedded code.


\begin{DoxyParams}{Parameters}
{\em func} & the name of the function to import into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importFunction(\textcolor{stringliteral}{"log"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em F\+U\+N\+C\+T\+I\+O\+N-\/\+I\+M\+P\+O\+R\+T-\/\+E\+R\+R\+OR} & Cannot import a function into the same \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; function with this name already exists \\
\hline
{\em P\+R\+O\+G\+R\+A\+M-\/\+I\+M\+P\+O\+R\+T\+F\+U\+N\+C\+T\+I\+O\+N-\/\+N\+O-\/\+F\+U\+N\+C\+T\+I\+ON} & The function does not exist \\
\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 function name 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 the function name can include a namespace path (ex {\ttfamily \char`\"{}\+Namespace\+::func\char`\"{}}) 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a4ea59c8d245e924b791a74cdb551946f}\label{class_qore_1_1_program_a4ea59c8d245e924b791a74cdb551946f}} 
\index{Qore::Program@{Qore::Program}!importFunction@{importFunction}}
\index{importFunction@{importFunction}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importFunction()}{importFunction()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::import\+Function (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{func,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{new\+\_\+name,  }\item[{\+\_\+\+\_\+7\+\_\+ softbool}]{inject }\end{DoxyParamCaption})}



Imports a function into the program object\textquotesingle{}s space and gives it a new name; any calls to the imported function will run with the parent \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\textquotesingle{}s permissions. 

This allows a user-\/defined A\+PI with greater capabilities than the embedded \mbox{\hyperlink{class_qore_1_1_program}{Program}} object to be imported into the embedded code.


\begin{DoxyParams}{Parameters}
{\em func} & the name of the function to import into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object \\
\hline
{\em new\+\_\+name} & the name of the function as it will be known in the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object once imported; can be a fully-\/qualified namespace path, in which case the namespace path will be created in the target \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if necessary as well (ex\+: {\ttfamily \char`\"{}\+Ns1\+::\+Ns2\+::my\+\_\+func\char`\"{}}) \\
\hline
{\em inject} & if \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} then the imported function will be marked as a dependency injection and therefore will not be overritten by subsequent calls to \mbox{\hyperlink{class_qore_1_1_program_adc115cc0b1c0f196ed0d764eb33c4009}{Program\+::import\+System\+Functions()}}, \mbox{\hyperlink{class_qore_1_1_program_a8abea6fe89712e9b4f84c7f7b0420151}{Program\+::import\+System\+Api()}}, \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}, or \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}; note that for this call to succeed, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} must have \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}} set\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importFunction(\textcolor{stringliteral}{"service\_log"}, \textcolor{stringliteral}{"log"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em F\+U\+N\+C\+T\+I\+O\+N-\/\+I\+M\+P\+O\+R\+T-\/\+E\+R\+R\+OR} & Cannot import a function into the same \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; function with this name already exists; target namespace does not exist; injection indicated but \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}} not set \\
\hline
{\em P\+R\+O\+G\+R\+A\+M-\/\+I\+M\+P\+O\+R\+T\+F\+U\+N\+C\+T\+I\+O\+N-\/\+N\+O-\/\+F\+U\+N\+C\+T\+I\+ON} & The function does not exist \\
\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 function name could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+4 the function name can include a namespace path (ex {\ttfamily \char`\"{}\+Namespace\+::func\char`\"{}})
\item Qore 0.\+8.\+12 added the {\itshape inject} parameter 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a5db34046e2722a8519642ad98f412ed3}\label{class_qore_1_1_program_a5db34046e2722a8519642ad98f412ed3}} 
\index{Qore::Program@{Qore::Program}!importGlobalVariable@{importGlobalVariable}}
\index{importGlobalVariable@{importGlobalVariable}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importGlobalVariable()}{importGlobalVariable()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::import\+Global\+Variable (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{varname,  }\item[{bool}]{readonly = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}} }\end{DoxyParamCaption})}



Imports a global variable into the program object\textquotesingle{}s space. 

If the variable is an object, then any methods called from the subprogram will run in the parent\textquotesingle{}s space


\begin{DoxyParams}{Parameters}
{\em varname} & The name of the global variable without the {\ttfamily \char`\"{}\$\char`\"{}} \\
\hline
{\em readonly} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the variable will be imported read-\/only, and cannot be changed by the subprogram (note that if the imported\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importGlobalVariable(\textcolor{stringliteral}{"var"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+I\+M\+P\+O\+R\+T\+G\+L\+O\+B\+A\+L\+V\+A\+R\+I\+A\+B\+L\+E-\/\+E\+X\+C\+E\+P\+T\+I\+ON} & The global variable does not exist in the source program, or the target variable already exists \\
\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 global variablt name could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}} \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_program_a029c9dbdbdc3dc13e685f7d101e5829e}\label{class_qore_1_1_program_a029c9dbdbdc3dc13e685f7d101e5829e}} 
\index{Qore::Program@{Qore::Program}!importHashDecl@{importHashDecl}}
\index{importHashDecl@{importHashDecl}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importHashDecl()}{importHashDecl()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::import\+Hash\+Decl (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{new\+\_\+name }\end{DoxyParamCaption})}



Imports a \mbox{\hyperlink{hashdecl}{typed hash declaration}} into the program object\textquotesingle{}s space. 

This allows a user-\/defined A\+PI with greater capabilities than the embedded \mbox{\hyperlink{class_qore_1_1_program}{Program}} object to be imported into the embedded code.


\begin{DoxyParams}{Parameters}
{\em name} & the name of the \mbox{\hyperlink{hashdecl}{typed hash declaration}} to import into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object \\
\hline
{\em new\+\_\+name} & the name of the \mbox{\hyperlink{hashdecl}{typed hash declaration}} in the imported \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; can be a fully-\/qualified namespace path, in which case the namespace path will be created in the target \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if necessary as well (ex\+: {\ttfamily \char`\"{}\+Ns1\+::\+Ns2\+::\+My\+Class\char`\"{}})\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importHashDecl(\textcolor{stringliteral}{"MyNamespace::MyHash"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em H\+A\+S\+H\+D\+E\+C\+L-\/\+I\+M\+P\+O\+R\+T-\/\+E\+R\+R\+OR} & Cannot import a hashdecl into the same \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; conflict with an existing definition \\
\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 hashdecl name could not be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a8abea6fe89712e9b4f84c7f7b0420151}\label{class_qore_1_1_program_a8abea6fe89712e9b4f84c7f7b0420151}} 
\index{Qore::Program@{Qore::Program}!importSystemApi@{importSystemApi}}
\index{importSystemApi@{importSystemApi}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importSystemApi()}{importSystemApi()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::import\+System\+Api (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



imports system classes and functions into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_ga52d1e7bd71353fe0b0669e9f5a078206}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+F\+U\+N\+C\+\_\+\+V\+A\+R\+I\+A\+N\+TS}}, \mbox{\hyperlink{group__parse__options_gaa3d360ed4159338ebbeee314914cb912}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+H\+A\+S\+H\+D\+E\+C\+LS}}, \mbox{\hyperlink{group__parse__options_gaec5488ae61db4b43af0e89ddc532e379}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+O\+N\+S\+T\+A\+N\+TS}}, and \mbox{\hyperlink{group__parse__options_gaedeb6f38e275c56932618969f60384ff}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+L\+A\+S\+S\+ES}} 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importSystemApi();}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+M\+P\+O\+R\+T-\/\+S\+Y\+S\+T\+E\+M-\/\+A\+P\+I-\/\+E\+R\+R\+OR} & objects already imported; parse options are locked on the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; conflicting object found; system A\+PI incorrectly imported; in case this exception is raised, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will not contain the full system A\+PI and is most likely unusable\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
removes \mbox{\hyperlink{group__parse__options_gaedeb6f38e275c56932618969f60384ff}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+L\+A\+S\+S\+ES}}, \mbox{\hyperlink{group__parse__options_gaa3d360ed4159338ebbeee314914cb912}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+H\+A\+S\+H\+D\+E\+C\+LS}}, \mbox{\hyperlink{group__parse__options_gaec5488ae61db4b43af0e89ddc532e379}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+O\+N\+S\+T\+A\+N\+TS}}, and \mbox{\hyperlink{group__parse__options_ga52d1e7bd71353fe0b0669e9f5a078206}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+F\+U\+N\+C\+\_\+\+V\+A\+R\+I\+A\+N\+TS}} from the parse option mask after a successful completion
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_ad512b5c0b491823d186e0de7cf8d87d4}\label{class_qore_1_1_program_ad512b5c0b491823d186e0de7cf8d87d4}} 
\index{Qore::Program@{Qore::Program}!importSystemClasses@{importSystemClasses}}
\index{importSystemClasses@{importSystemClasses}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importSystemClasses()}{importSystemClasses()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::import\+System\+Classes (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



imports system classes into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_gaedeb6f38e275c56932618969f60384ff}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+L\+A\+S\+S\+ES}} 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importSystemClasses();}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+M\+P\+O\+R\+T-\/\+S\+Y\+S\+T\+E\+M-\/\+A\+P\+I-\/\+E\+R\+R\+OR} & objects already imported; parse options are locked on the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; conflicting object found; system A\+PI incorrectly imported; in case this exception is raised, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will not contain the full system A\+PI and is most likely unusable\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
removes \mbox{\hyperlink{group__parse__options_gaedeb6f38e275c56932618969f60384ff}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+L\+A\+S\+S\+ES}} from the parse option mask after a successful completion
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a2942f186ac759fb7a71cbb9ec0ffb72a}\label{class_qore_1_1_program_a2942f186ac759fb7a71cbb9ec0ffb72a}} 
\index{Qore::Program@{Qore::Program}!importSystemConstants@{importSystemConstants}}
\index{importSystemConstants@{importSystemConstants}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importSystemConstants()}{importSystemConstants()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::import\+System\+Constants (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



imports system constants into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_gaec5488ae61db4b43af0e89ddc532e379}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+O\+N\+S\+T\+A\+N\+TS}} 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importSystemConstants();}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+M\+P\+O\+R\+T-\/\+S\+Y\+S\+T\+E\+M-\/\+A\+P\+I-\/\+E\+R\+R\+OR} & objects already imported; parse options are locked on the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; conflicting object found; system A\+PI incorrectly imported; in case this exception is raised, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will not contain the full system A\+PI and is most likely unusable\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
removes \mbox{\hyperlink{group__parse__options_gaec5488ae61db4b43af0e89ddc532e379}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+C\+O\+N\+S\+T\+A\+N\+TS}} from the parse option mask after a successful completion
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_adc115cc0b1c0f196ed0d764eb33c4009}\label{class_qore_1_1_program_adc115cc0b1c0f196ed0d764eb33c4009}} 
\index{Qore::Program@{Qore::Program}!importSystemFunctions@{importSystemFunctions}}
\index{importSystemFunctions@{importSystemFunctions}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importSystemFunctions()}{importSystemFunctions()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::import\+System\+Functions (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



imports system functions into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_ga52d1e7bd71353fe0b0669e9f5a078206}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+F\+U\+N\+C\+\_\+\+V\+A\+R\+I\+A\+N\+TS}} 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importSystemFunctions();}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+M\+P\+O\+R\+T-\/\+S\+Y\+S\+T\+E\+M-\/\+A\+P\+I-\/\+E\+R\+R\+OR} & objects already imported; parse options are locked on the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; conflicting object found; system A\+PI incorrectly imported; in case this exception is raised, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will not contain the full system A\+PI and is most likely unusable\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
removes \mbox{\hyperlink{group__parse__options_ga52d1e7bd71353fe0b0669e9f5a078206}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+F\+U\+N\+C\+\_\+\+V\+A\+R\+I\+A\+N\+TS}} from the parse option mask after a successful completion
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a4aef71f37e505dbe84be95b0a2848cba}\label{class_qore_1_1_program_a4aef71f37e505dbe84be95b0a2848cba}} 
\index{Qore::Program@{Qore::Program}!importSystemHashDecls@{importSystemHashDecls}}
\index{importSystemHashDecls@{importSystemHashDecls}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{importSystemHashDecls()}{importSystemHashDecls()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::import\+System\+Hash\+Decls (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



imports system hashdecls into a \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at runtime; will throw an exception if the \mbox{\hyperlink{class_qore_1_1_program}{Program}} was not created with \mbox{\hyperlink{group__parse__options_gaa3d360ed4159338ebbeee314914cb912}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+H\+A\+S\+H\+D\+E\+C\+LS}} 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.importSystemHashDecls();}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+M\+P\+O\+R\+T-\/\+S\+Y\+S\+T\+E\+M-\/\+A\+P\+I-\/\+E\+R\+R\+OR} & objects already imported; parse options are locked on the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; conflicting object found; system A\+PI incorrectly imported; in case this exception is raised, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will not contain the full system A\+PI and is most likely unusable\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
removes \mbox{\hyperlink{group__parse__options_gaa3d360ed4159338ebbeee314914cb912}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+I\+N\+H\+E\+R\+I\+T\+\_\+\+S\+Y\+S\+T\+E\+M\+\_\+\+H\+A\+S\+H\+D\+E\+C\+LS}} from the parse option mask after a successful completion
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_afcfa159016f0f76d7a1abdf8e3895b6b}\label{class_qore_1_1_program_afcfa159016f0f76d7a1abdf8e3895b6b}} 
\index{Qore::Program@{Qore::Program}!isDefined@{isDefined}}
\index{isDefined@{isDefined}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{isDefined()}{isDefined()}}
{\footnotesize\ttfamily bool Qore\+::\+Program\+::is\+Defined (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{def }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the given \mbox{\hyperlink{conditional_parsing}{parse define}} is defined in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} (does not have to have a value defined to return \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}), \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not. 

\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{DoxyParams}{Parameters}
{\em def} & The name of the define to check\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the given \mbox{\hyperlink{conditional_parsing}{parse define}} is defined in the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} (does not have to have a value defined to return \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}), \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool b = pgm.isDefined(\textcolor{stringliteral}{"PRODUCTION"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & this error is thrown if the string cannot be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}} \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_program_afe6fc6b4013b8e2ff209ac9dad421487}\label{class_qore_1_1_program_afe6fc6b4013b8e2ff209ac9dad421487}} 
\index{Qore::Program@{Qore::Program}!issueModuleCmd@{issueModuleCmd}}
\index{issueModuleCmd@{issueModuleCmd}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{issueModuleCmd()}{issueModuleCmd()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::issue\+Module\+Cmd (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{module,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{cmd }\end{DoxyParamCaption})}



issues a module command for the given module; the module is loaded into the current Program object if it is not already present 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.issueModuleCmd(\textcolor{stringliteral}{"jni"}, \textcolor{stringliteral}{"define-class "} + java\_class\_path\_name + \textcolor{stringliteral}{" "} + byte\_code.toBase64());}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em module} & the module name \\
\hline
{\em cmd} & the command string to execute to be parsed by the module\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em P\+A\+R\+S\+E-\/\+C\+O\+M\+M\+A\+N\+D-\/\+E\+R\+R\+OR} & the module does not support commands\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
command errors can result in other module-\/ and command-\/specific exceptions being thrown; see documentation for the module and command in question for more details
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+9 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}\label{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}} 
\index{Qore::Program@{Qore::Program}!loadApplyToPrivateUserModule@{loadApplyToPrivateUserModule}}
\index{loadApplyToPrivateUserModule@{loadApplyToPrivateUserModule}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadApplyToPrivateUserModule()}{loadApplyToPrivateUserModule()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::load\+Apply\+To\+Private\+User\+Module (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore user module privately into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. 

This method allows a user module to be privately loaded with a custom A\+PI already present in the user module\textquotesingle{}s \mbox{\hyperlink{class_qore_1_1_program}{Program}} container.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & the name or path of the user module to load \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; note that warnings are treated as errors\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: binary modules cannot be loaded in \mbox{\hyperlink{class_qore_1_1_program}{Program}} containers, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will be owned by the user module and will no longer be valid, so any accesses to the object after this call will result in an exception
\item this module will not be available for use in other \mbox{\hyperlink{class_qore_1_1_program}{Program}} objects; this method is useful for loading modules that register themselves with an injected A\+PI in code that does not have \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}} set or where the module\textquotesingle{}s functionality should be protected from other Qore code
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{Program\+::load\+Apply\+To\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{Program\+::load\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{Program\+::load\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{Program\+::load\+User\+Module\+With\+Program()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{Program\+::load\+User\+Module\+With\+Program\+Warn()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9 added the {\ttfamily warning\+\_\+mask} parameter 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}\label{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}} 
\index{Qore::Program@{Qore::Program}!loadApplyToPrivateUserModuleWarn@{loadApplyToPrivateUserModuleWarn}}
\index{loadApplyToPrivateUserModuleWarn@{loadApplyToPrivateUserModuleWarn}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadApplyToPrivateUserModuleWarn()}{loadApplyToPrivateUserModuleWarn()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}}$>$ Qore\+::\+Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore user module privately into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. 

This method allows a user module to be privately loaded with a custom A\+PI already present in the user module\textquotesingle{}s \mbox{\hyperlink{class_qore_1_1_program}{Program}} container.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & the name or path of the user module to load \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; any warnings will be returned in the return value\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
any warnings found while parsing the module (if the module is a user module)
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: binary modules cannot be loaded in \mbox{\hyperlink{class_qore_1_1_program}{Program}} containers, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will be owned by the user module and will no longer be valid, so any accesses to the object after this call will result in an exception
\item this module will not be available for use in other \mbox{\hyperlink{class_qore_1_1_program}{Program}} objects; this method is useful for loading modules that register themselves with an injected A\+PI in code that does not have \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}} set or where the module\textquotesingle{}s functionality should be protected from other Qore code
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{Program\+::load\+Apply\+To\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{Program\+::load\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{Program\+::load\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{Program\+::load\+User\+Module\+With\+Program()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{Program\+::load\+User\+Module\+With\+Program\+Warn()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9 added the {\ttfamily warning\+\_\+mask} parameter 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}\label{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}} 
\index{Qore::Program@{Qore::Program}!loadApplyToUserModule@{loadApplyToUserModule}}
\index{loadApplyToUserModule@{loadApplyToUserModule}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadApplyToUserModule()}{loadApplyToUserModule()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::load\+Apply\+To\+User\+Module (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\+\_\+\+\_\+7\+\_\+ softbool}]{reinject,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore user module into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. 

This method allows a user module to be loaded with a custom A\+PI already present in the user module\textquotesingle{}s \mbox{\hyperlink{class_qore_1_1_program}{Program}} container.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}, M\+U\+ST H\+A\+VE\+: \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & the name or path of the user module to load \\
\hline
{\em reinject} & if \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} then the module will be reloaded even if already loaded previously; if the module was not already loaded then it is loaded with this call \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; note that warnings are treated as errors\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: binary modules cannot be loaded in \mbox{\hyperlink{class_qore_1_1_program}{Program}} containers, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item it is not an error to set the {\itshape reinject} argument to \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} when the given module has not already been loaded
\item after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will be owned by the user module and will no longer be valid, so any accesses to the object after this call will result in an exception
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{Program\+::load\+Apply\+To\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{Program\+::load\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{Program\+::load\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{Program\+::load\+User\+Module\+With\+Program()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{Program\+::load\+User\+Module\+With\+Program\+Warn()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9 added the {\ttfamily warning\+\_\+mask} parameter 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}\label{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}} 
\index{Qore::Program@{Qore::Program}!loadApplyToUserModuleWarn@{loadApplyToUserModuleWarn}}
\index{loadApplyToUserModuleWarn@{loadApplyToUserModuleWarn}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadApplyToUserModuleWarn()}{loadApplyToUserModuleWarn()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}}$>$ Qore\+::\+Program\+::load\+Apply\+To\+User\+Module\+Warn (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\+\_\+\+\_\+7\+\_\+ softbool}]{reinject,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore user module into the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} container at run-\/time; after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is owned by the user module and is no longer accessible in the object used for the call. 

This method allows a user module to be loaded with a custom A\+PI already present in the user module\textquotesingle{}s \mbox{\hyperlink{class_qore_1_1_program}{Program}} container.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}, M\+U\+ST H\+A\+VE\+: \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & the name or path of the user module to load \\
\hline
{\em reinject} & if \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} then the module will be reloaded even if already loaded previously; if the module was not already loaded then it is loaded with this call \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; any warnings will be returned in the return value\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
any warnings found while parsing the module (if the module is a user module)
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: binary modules cannot be loaded in \mbox{\hyperlink{class_qore_1_1_program}{Program}} containers, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item it is not an error to set the {\itshape reinject} argument to \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} when the given module has not already been loaded
\item after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will be owned by the user module and will no longer be valid, so any accesses to the object after this call will result in an exception
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{Program\+::load\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{Program\+::load\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{Program\+::load\+User\+Module\+With\+Program()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{Program\+::load\+User\+Module\+With\+Program\+Warn()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9 added the {\ttfamily warning\+\_\+mask} parameter 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}\label{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}} 
\index{Qore::Program@{Qore::Program}!loadModule@{loadModule}}
\index{loadModule@{loadModule}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadModule()}{loadModule()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::load\+Module (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time. 

If a feature with the same name already exists, then this feature\textquotesingle{}s code is imported into the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if necessary and no further action is taken.

Note that modules providing objects resolved at parse time (classes, constants, functions, etc) must be loaded prior to parsing.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & either a feature name (a module will be searched with this feature name) or a path to a module to load \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; note that warnings are treated as errors\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.loadModule(\textcolor{stringliteral}{"mysql"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: A\+PI incompatibility, module defines symbols already defined in the target object, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{Program\+::load\+Apply\+To\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{Program\+::load\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{Program\+::load\+User\+Module\+With\+Program()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{Program\+::load\+User\+Module\+With\+Program\+Warn()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+7 introduced this method
\item Qore 0.\+9 added the {\ttfamily warning\+\_\+mask} parameter 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}\label{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}} 
\index{Qore::Program@{Qore::Program}!loadModuleWarn@{loadModuleWarn}}
\index{loadModuleWarn@{loadModuleWarn}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadModuleWarn()}{loadModuleWarn()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}}$>$ Qore\+::\+Program\+::load\+Module\+Warn (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time. 

If a feature with the same name already exists, then this feature\textquotesingle{}s code is imported into the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if necessary and no further action is taken.

Note that modules providing objects resolved at parse time (classes, constants, functions, etc) must be loaded prior to parsing.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & either a feature name (a module will be searched with this feature name) or a path to a module to load \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; any warnings will be returned in the return value\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
any warnings found while parsing the module (if the module is a user module)
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.loadModule(\textcolor{stringliteral}{"mysql"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: A\+PI incompatibility, module defines symbols already defined in the target object, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{Program\+::load\+Apply\+To\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{Program\+::load\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{Program\+::load\+User\+Module\+With\+Program()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{Program\+::load\+User\+Module\+With\+Program\+Warn()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9 introduced this method 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}\label{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}} 
\index{Qore::Program@{Qore::Program}!loadUserModuleWithProgram@{loadUserModuleWithProgram}}
\index{loadUserModuleWithProgram@{loadUserModuleWithProgram}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadUserModuleWithProgram()}{loadUserModuleWithProgram()}}
{\footnotesize\ttfamily Qore\+::\+Program\+::load\+User\+Module\+With\+Program (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\mbox{\hyperlink{class_qore_1_1_program}{Qore\+::\+Program}}}]{pgm,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore user module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time using the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} object as the container for the user module code. 

This method allows a user module to be loaded with a custom A\+PI already present in the user module\textquotesingle{}s \mbox{\hyperlink{class_qore_1_1_program}{Program}} container. If a feature with the same name already exists, then this feature\textquotesingle{}s code is imported into the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if necessary and no further action is taken.

Note that modules providing objects resolved at parse time (classes, constants, functions, etc) must be loaded prior to parsing.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}, M\+U\+ST H\+A\+VE\+: \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.loadUserModuleWithProgram(\textcolor{stringliteral}{"MyModule"}, p);}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & the name or path of the user module to load \\
\hline
{\em pgm} & the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object to use as a container for the new user module, presumably this has a custom A\+PI that the user module can use; note that after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will be owned by the user module, therefore the object itself will no longer be valid and any accesses to the object after this call will result in an exception \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; note that warnings are treated as errors\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: binary modules cannot be loaded in \mbox{\hyperlink{class_qore_1_1_program}{Program}} containers, module defines symbols already defined in the target object, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{Program\+::load\+Apply\+To\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{Program\+::load\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{Program\+::load\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}{Program\+::load\+User\+Module\+With\+Program\+Warn()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+12 introduced this method
\item Qore 0.\+9 added the {\ttfamily warning\+\_\+mask} parameter 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}\label{class_qore_1_1_program_a1675c1af5ba3d423af82dbc026c0202f}} 
\index{Qore::Program@{Qore::Program}!loadUserModuleWithProgramWarn@{loadUserModuleWithProgramWarn}}
\index{loadUserModuleWithProgramWarn@{loadUserModuleWithProgramWarn}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{loadUserModuleWithProgramWarn()}{loadUserModuleWithProgramWarn()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}}$>$ Qore\+::\+Program\+::load\+User\+Module\+With\+Program\+Warn (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{\mbox{\hyperlink{class_qore_1_1_program}{Qore\+::\+Program}}}]{pgm,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask = {\ttfamily \mbox{\hyperlink{group__warning__constants_ga7f704aa8f7652702d72d22ce93125566}{W\+A\+R\+N\+\_\+\+M\+O\+D\+U\+L\+ES}}} }\end{DoxyParamCaption})}



Loads a Qore user module into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object at run-\/time using the given \mbox{\hyperlink{class_qore_1_1_program}{Program}} object as the container for the user module code. 

This method allows a user module to be loaded with a custom A\+PI already present in the user module\textquotesingle{}s \mbox{\hyperlink{class_qore_1_1_program}{Program}} container. If a feature with the same name already exists, then this feature\textquotesingle{}s code is imported into the current \mbox{\hyperlink{class_qore_1_1_program}{Program}} object if necessary and no further action is taken.

Note that modules providing objects resolved at parse time (classes, constants, functions, etc) must be loaded prior to parsing.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gaccf9af08f7acb25e66b777dcb4c4563b}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+M\+O\+D\+U\+L\+ES}}, M\+U\+ST H\+A\+VE\+: \mbox{\hyperlink{group__parse__options_ga1c78ca9bda4b8f5b2ad669c48fe0368d}{Qore\+::\+P\+O\+\_\+\+A\+L\+L\+O\+W\+\_\+\+I\+N\+J\+E\+C\+T\+I\+ON}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.loadUserModuleWithProgram(\textcolor{stringliteral}{"MyModule"}, p);}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & the name or path of the user module to load \\
\hline
{\em pgm} & the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object to use as a container for the new user module, presumably this has a custom A\+PI that the user module can use; note that after this call the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object will be owned by the user module, therefore the object itself will no longer be valid and any accesses to the object after this call will result in an exception \\
\hline
{\em warning\+\_\+mask} & the warning mask to use when loading the module; any warnings will be returned in the return value\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
any warnings found while parsing the module (if the module is a user module)
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em L\+O\+A\+D-\/\+M\+O\+D\+U\+L\+E-\/\+E\+R\+R\+OR} & module cannot be loaded\+: binary modules cannot be loaded in \mbox{\hyperlink{class_qore_1_1_program}{Program}} containers, module defines symbols already defined in the target object, etc\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_a2f83d6257c25cc5ae867d9d461019996}{Program\+::load\+Apply\+To\+Private\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ae15ccde47d36af187a972a6468bafc2a}{Program\+::load\+Apply\+To\+Private\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acd9c44ff76909f62106f83b3c5011772}{Program\+::load\+Apply\+To\+User\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ab2072ecb954ec19baed8a2107f4cd23d}{Program\+::load\+Apply\+To\+User\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a9bc54a95f735cdc10bfb52e5166259b2}{Program\+::load\+Module()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a08a74eec43638d3132b99de1479c0a27}{Program\+::load\+Module\+Warn()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a88ead6a191a58736b49e794f3220869f}{Program\+::load\+User\+Module\+With\+Program()}}
\item \mbox{\hyperlink{group__misc__functions_gab64b871ddf6f09568d4a0798c0ca755a}{get\+\_\+module\+\_\+hash()}}
\item \mbox{\hyperlink{group__misc__functions_ga86de08439e084c19460ae57d3d6269e5}{get\+\_\+feature\+\_\+list()}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+9 introduced this method 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_ae3548963216fe5426a7dad63c20afb59}\label{class_qore_1_1_program_ae3548963216fe5426a7dad63c20afb59}} 
\index{Qore::Program@{Qore::Program}!lockOptions@{lockOptions}}
\index{lockOptions@{lockOptions}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{lockOptions()}{lockOptions()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::lock\+Options (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Locks parse options so that they cannot be changed. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.lockOptions();}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}\label{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}} 
\index{Qore::Program@{Qore::Program}!parse@{parse}}
\index{parse@{parse}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{parse()}{parse()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}}$>$ Qore\+::\+Program\+::parse (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{label,  }\item[{\+\_\+\+\_\+7\+\_\+ softint}]{warning\+\_\+mask,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{source,  }\item[{\+\_\+\+\_\+7\+\_\+ softint}]{offset,  }\item[{softbool}]{format\+\_\+label = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Parses the string argument and adds the code to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. 

This method causes both stages of parsing to be executed; if this method is successful, then the code parsed is committed to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. This method is equivalent to calling \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}} and \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}} in one atomic call.

If an exception occurs in this method, all pending code is backed out, not just code parsed by this method (for example, in case uncommitted code added by \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}} also exists in the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object before calling this method).

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gab1337f461ab4a90df9b39a7f1b6cc2b0}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+E\+M\+B\+E\+D\+D\+E\+D\+\_\+\+L\+O\+G\+IC}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em code} & The code to parse into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object \\
\hline
{\em label} & The label for the code; this label will be given if any parse or run-\/time errors are raised for the code given \\
\hline
{\em warning\+\_\+mask} & An optional warning mask; see \mbox{\hyperlink{group__warning__constants}{Warning Constants}} for values to combine by binary-\/or; if this argument is 0 or not given then no warnings will be checked or issued and the return value will always be \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} \\
\hline
{\em source} & An optional source file name for the code being parsed; this is useful if sections of a file are parsed \\
\hline
{\em offset} & An optional line offset for use with the {\itshape source} parameter; this gives the line offset in the file to the code being parsed \\
\hline
{\em format\+\_\+label} & obsolete / ignored since Qore 0.\+9\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
If warning included in the warning mask are raised during parsing, this method will return an \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} hash with warning information, otherwise \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} is returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*hash<ExceptionInfo> wh = pgm.parse(code, \textcolor{stringliteral}{"label"}, WARN\_DEFAULT);}
\DoxyCodeLine{\textcolor{keywordflow}{while} (wh) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"warning: \%s:\%d: \%s: \%s\(\backslash\)n"}, wh.file, wh.line, wh.err, wh.desc);}
\DoxyCodeLine{    wh = wh.next;}
\DoxyCodeLine{\}}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
This method could throw many parse exceptions which are not enumerated here; any parse errors will result in an appropriate exception.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Qore\+::\+Program\+::parse\+Pending()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Qore\+::\+Program\+::parse\+Commit()}}
\item \mbox{\hyperlink{group__misc__functions_ga11da5fd06dcfa57a48a5381268a52086}{Qore\+::parse()}}
\end{DoxyItemize}
\end{DoxySeeAlso}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+P\+A\+R\+S\+E-\/\+E\+R\+R\+OR} & this exception is thrown if any parse actions are started while the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object has running threads\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
A complete parse action (\mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Program\+::parse()}} or \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}}) can only be performed once; subsequent attempts to parse code into the same Program object will fail with an exception. If parsing fails due to a parse exception, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is generally no longer usable and must be recreated to be used.
\end{DoxyNote}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+7 the {\itshape source}, {\itshape offset}, and {\itshape format\+\_\+label} arguments were added
\item Qore 0.\+9 parsing can only be executed once per Program object
\item Qore 0.\+9 the {\itshape format\+\_\+label} is obsolete / ignored 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}\label{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}} 
\index{Qore::Program@{Qore::Program}!parseCommit@{parseCommit}}
\index{parseCommit@{parseCommit}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{parseCommit()}{parseCommit()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::parse\+Commit (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Commits and pending code processed with \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}} to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object after resolving all outstanding references in the pending code. 

An exception in this method causes all pending code to be rolled back immediately.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.parseCommit();}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
This method could throw many parse exceptions related to resolving references which are not enumerated here; any parse errors will result in an appropriate exception.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Qore\+::\+Program\+::parse()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Qore\+::\+Program\+::parse\+Pending()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}{Qore\+::\+Program\+::parse\+Rollback()}}
\item \mbox{\hyperlink{group__misc__functions_ga11da5fd06dcfa57a48a5381268a52086}{Qore\+::parse()}}
\end{DoxyItemize}
\end{DoxySeeAlso}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+P\+A\+R\+S\+E-\/\+E\+R\+R\+OR} & this exception is thrown if any parse actions are started while the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object has running threads\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
A complete parse action (\mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Program\+::parse()}} or \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}}) can only be performed once; subsequent attempts to parse code into the same Program object will fail with an exception. If parsing fails due to a parse exception, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is generally no longer usable and must be recreated to be used.
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+9 parsing can only be executed once per Program object 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a444d96ebbcec2384058ce44b78198d17}\label{class_qore_1_1_program_a444d96ebbcec2384058ce44b78198d17}} 
\index{Qore::Program@{Qore::Program}!parseCommit@{parseCommit}}
\index{parseCommit@{parseCommit}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{parseCommit()}{parseCommit()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}}$>$ Qore\+::\+Program\+::parse\+Commit (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+mask }\end{DoxyParamCaption})}



Commits and pending code processed with \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Program\+::parse\+Pending()}} to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object after resolving all outstanding references in the pending code. 

An exception in this method causes all pending code to be rolled back immediately.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*hash<ExceptionInfo> wh = pgm.parseCommit(WARN\_DEFAULT);}
\DoxyCodeLine{\textcolor{keywordflow}{while} (exists wh) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"warning: \%s:\%d: \%s: \%s\(\backslash\)n"}, wh.file, wh.line, wh.err, wh.desc);}
\DoxyCodeLine{    wh = wh.next;}
\DoxyCodeLine{\}}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
This method could throw many parse exceptions related to resolving references which are not enumerated here; any parse errors will result in an appropriate exception.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Qore\+::\+Program\+::parse()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Qore\+::\+Program\+::parse\+Pending()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}{Qore\+::\+Program\+::parse\+Rollback()}}
\item \mbox{\hyperlink{group__misc__functions_ga11da5fd06dcfa57a48a5381268a52086}{Qore\+::parse()}}
\end{DoxyItemize}
\end{DoxySeeAlso}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+P\+A\+R\+S\+E-\/\+E\+R\+R\+OR} & this exception is thrown if any parse actions are started while the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object has running threads\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
A complete parse action (\mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Program\+::parse()}} or \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}}) can only be performed once; subsequent attempts to parse code into the same Program object will fail with an exception. If parsing fails due to a parse exception, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is generally no longer usable and must be recreated to be used.
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+9 parsing can only be executed once per Program object 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}\label{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}} 
\index{Qore::Program@{Qore::Program}!parsePending@{parsePending}}
\index{parsePending@{parsePending}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{parsePending()}{parsePending()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$\mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}}$>$ Qore\+::\+Program\+::parse\+Pending (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{code,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{label,  }\item[{\+\_\+\+\_\+7\+\_\+ softint}]{warning\+\_\+mask,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{source,  }\item[{\+\_\+\+\_\+7\+\_\+ softint}]{offset,  }\item[{softbool}]{format\+\_\+label = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Parses the text passed to pending lists in the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; does not resolve all references or commit the code to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. 

References are resolved in the \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}} method.

\mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}} must be called to resolve all references and commit the code to the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object; until \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}} is called, none of the code parsed by this method will be available for execution in the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object.

If an exception occurs in this method, all pending code is backed out, not just code parsed by this method.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gab1337f461ab4a90df9b39a7f1b6cc2b0}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+E\+M\+B\+E\+D\+D\+E\+D\+\_\+\+L\+O\+G\+IC}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em code} & The code to parse into the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object \\
\hline
{\em label} & The label for the code; this label will be given if any parse or run-\/time errors are raised for the code given \\
\hline
{\em warning\+\_\+mask} & An optional warning mask; see \mbox{\hyperlink{group__warning__constants}{Warning Constants}} for values to combine by binary-\/or; if this argument is 0 or not given then no warnings will be checked or issued and the return value will always be \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} \\
\hline
{\em source} & An optional source file name for the code being parsed; this is useful if sections of a file are parsed \\
\hline
{\em offset} & An optional line offset for use with the {\itshape source} parameter; this gives the line offset in the file to the code being parsed \\
\hline
{\em format\+\_\+label} & obsolete / ignored since Qore 0.\+9\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
If warning included in the warning mask are raised during parsing, this method will return an \mbox{\hyperlink{struct_qore_1_1_exception_info}{Exception\+Info}} hash with warning information, otherwise \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} is returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*hash<ExceptionInfo> wh = pgm.parsePending(code, \textcolor{stringliteral}{"label"}, WARN\_DEFAULT);}
\DoxyCodeLine{\textcolor{keywordflow}{while} (wh) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"warning: \%s:\%d: \%s: \%s\(\backslash\)n"}, wh.file, wh.line, wh.err, wh.desc);}
\DoxyCodeLine{    wh = wh.next;}
\DoxyCodeLine{\}}
\DoxyCodeLine{pgm.parseCommit();}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
This method could throw many parse exceptions which are not enumerated here; any parse errors will result in an appropriate exception.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Qore\+::\+Program\+::parse()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Qore\+::\+Program\+::parse\+Commit()}}
\item \mbox{\hyperlink{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}{Qore\+::\+Program\+::parse\+Rollback()}}
\item \mbox{\hyperlink{group__misc__functions_ga11da5fd06dcfa57a48a5381268a52086}{Qore\+::parse()}}
\end{DoxyItemize}
\end{DoxySeeAlso}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+P\+A\+R\+S\+E-\/\+E\+R\+R\+OR} & this exception is thrown if any parse actions are started while the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object has running threads\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
A complete parse action (\mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Program\+::parse()}} or \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Program\+::parse\+Commit()}}) can only be performed once; subsequent attempts to parse code into the same Program object will fail with an exception. If parsing fails due to a parse exception, the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object is generally no longer usable and must be recreated to be used.
\end{DoxyNote}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+7 the {\itshape source}, {\itshape offset}, and {\itshape format\+\_\+label} arguments were added
\item Qore 0.\+9 parsing can only be executed once per Program object
\item Qore 0.\+9 the {\itshape format\+\_\+label} is obsolete / ignored 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}\label{class_qore_1_1_program_acc27af9225963f20947e0045186ecfb7}} 
\index{Qore::Program@{Qore::Program}!parseRollback@{parseRollback}}
\index{parseRollback@{parseRollback}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{parseRollback()}{parseRollback()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::parse\+Rollback (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Removes all partially or fully-\/parsed code from the object along with other builtin objects; a Program object is not usable after calling this method; do not use this method but instead destroy the Program object. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_DEPRECATED}{D\+E\+P\+R\+E\+C\+A\+T\+ED}}
\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{Qore\+::\+Program\+::parse()}}
\item \mbox{\hyperlink{class_qore_1_1_program_a789d84e0f40137ad3b38064378b50e1b}{Qore\+::\+Program\+::parse\+Commit()}}
\item \mbox{\hyperlink{class_qore_1_1_program_ac943bad226fcf69ce5007b101828f8c1}{Qore\+::\+Program\+::parse\+Pending()}}
\item \mbox{\hyperlink{group__misc__functions_ga11da5fd06dcfa57a48a5381268a52086}{Qore\+::parse()}}
\end{DoxyItemize}
\end{DoxySeeAlso}

\begin{DoxyExceptions}{Exceptions}
{\em P\+R\+O\+G\+R\+A\+M-\/\+P\+A\+R\+S\+E-\/\+E\+R\+R\+OR} & this exception is thrown if any parse actions are started while the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object has running threads\\
\hline
\end{DoxyExceptions}
\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000001}{Deprecated}}]if parsing fails or is rolled back, the Program object is no longer usable \end{DoxyRefDesc}
\mbox{\Hypertarget{class_qore_1_1_program_a2d1d26dcb43d846cec1ecf926115b857}\label{class_qore_1_1_program_a2d1d26dcb43d846cec1ecf926115b857}} 
\index{Qore::Program@{Qore::Program}!replaceParseOptions@{replaceParseOptions}}
\index{replaceParseOptions@{replaceParseOptions}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{replaceParseOptions()}{replaceParseOptions()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::replace\+Parse\+Options (\begin{DoxyParamCaption}\item[{softint}]{opt }\end{DoxyParamCaption})}



Replaces the parse options for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. 

An {\ttfamily O\+P\+T\+I\+O\+N-\/\+E\+R\+R\+OR} exception is thrown if the calling \mbox{\hyperlink{class_qore_1_1_program}{Program}} object does not have \mbox{\hyperlink{group__parse__options_gaa567ec1170360b9ca111402c5179109f}{P\+O\+\_\+\+N\+O\+\_\+\+C\+H\+I\+L\+D\+\_\+\+P\+O\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+I\+O\+NS}} set.


\begin{DoxyParams}{Parameters}
{\em opt} & A single \mbox{\hyperlink{group__parse__options}{parse option}} or binary-\/or\textquotesingle{}ed combination of \mbox{\hyperlink{group__parse__options}{parse options}} to unset in the parse option mask for the object\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{\# disallow threading and GUI operations}}
\DoxyCodeLine{pgm.replaceParseOptions(PO\_NO\_THREADS | PO\_NO\_GUI);}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em O\+P\+T\+I\+O\+N-\/\+E\+R\+R\+OR} & The calling \mbox{\hyperlink{class_qore_1_1_program}{Program}} does not have the \mbox{\hyperlink{group__parse__options_gaa567ec1170360b9ca111402c5179109f}{P\+O\+\_\+\+N\+O\+\_\+\+C\+H\+I\+L\+D\+\_\+\+P\+O\+\_\+\+R\+E\+S\+T\+R\+I\+C\+T\+I\+O\+NS}} option set, and therefore cannot call \mbox{\hyperlink{class_qore_1_1_program_a2d1d26dcb43d846cec1ecf926115b857}{Program\+::replace\+Parse\+Options()}}\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_program_a046e332aac8933c562fef80cd5abf0cb}{Program\+::set\+Parse\+Options()}} and \mbox{\hyperlink{class_qore_1_1_program_a1f1e259bc987a7e4627e3ac2cc0c96b5}{Program\+::disable\+Parse\+Options()}}. 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_program_a6b2c023e8c1d81279ef8320f5901d5e3}\label{class_qore_1_1_program_a6b2c023e8c1d81279ef8320f5901d5e3}} 
\index{Qore::Program@{Qore::Program}!run@{run}}
\index{run@{run}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{run()}{run()}}
{\footnotesize\ttfamily auto Qore\+::\+Program\+::run (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Runs the program and optionally returns a value if the top-\/level code exits with a \mbox{\hyperlink{statements_return}{return statement.}}

\begin{DoxyReturn}{Returns}
the value given to the \mbox{\hyperlink{statements_return}{return statement}} at the top-\/level, if any, otherwise \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.run();}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_a8be97bfcd125d83a9415c843694734ac}\label{class_qore_1_1_program_a8be97bfcd125d83a9415c843694734ac}} 
\index{Qore::Program@{Qore::Program}!setGlobalVarValue@{setGlobalVarValue}}
\index{setGlobalVarValue@{setGlobalVarValue}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{setGlobalVarValue()}{setGlobalVarValue()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::set\+Global\+Var\+Value (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{name,  }\item[{auto}]{value }\end{DoxyParamCaption})}



set the value of a global variable 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.setGlobalVarValue(\textcolor{stringliteral}{"a"}, 1);}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em name} & the name of the variable \\
\hline
{\em value} & the value to assign\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em U\+N\+K\+N\+O\+W\+N-\/\+V\+A\+R\+I\+A\+B\+LE} & the variable is not a global variable\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other exceptions could be thrown if the value cannot be assigned to the given variable
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__misc__functions_gaea05595c0ea4cf4affef51c323c7eed1}{Qore\+::set\+\_\+global\+\_\+var\+\_\+value()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a046e332aac8933c562fef80cd5abf0cb}\label{class_qore_1_1_program_a046e332aac8933c562fef80cd5abf0cb}} 
\index{Qore::Program@{Qore::Program}!setParseOptions@{setParseOptions}}
\index{setParseOptions@{setParseOptions}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{setParseOptions()}{setParseOptions()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::set\+Parse\+Options (\begin{DoxyParamCaption}\item[{softint}]{opt = {\ttfamily \mbox{\hyperlink{group__parse__options_gaf8ee107760d23b03c6db359c872cc0f9}{P\+O\+\_\+\+D\+E\+F\+A\+U\+LT}}} }\end{DoxyParamCaption})}



Sets parse options in the parse option mask for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object. 

An {\ttfamily O\+P\+T\+I\+O\+N\+S-\/\+L\+O\+C\+K\+ED} exception is thrown if parse options have been locked (for example with \mbox{\hyperlink{class_qore_1_1_program_ae3548963216fe5426a7dad63c20afb59}{Program\+::lock\+Options()}})


\begin{DoxyParams}{Parameters}
{\em opt} & A single \mbox{\hyperlink{group__parse__options}{parse option}} or binary-\/or\textquotesingle{}ed combination of \mbox{\hyperlink{group__parse__options}{parse options}} to set in the parse option mask for the object; the given argument will be combined with binary or with the existing parse option mask\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{\# disable threading and GUI operations}}
\DoxyCodeLine{pgm.setParseOptions(PO\_NO\_THREADS | PO\_NO\_GUI);}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em O\+P\+T\+I\+O\+N\+S-\/\+L\+O\+C\+K\+ED} & Parse options have been locked and cannot be changed \\
\hline
{\em P\+R\+O\+G\+R\+A\+M-\/\+O\+P\+T\+I\+O\+N-\/\+E\+R\+R\+OR} & invalid parse options used\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_program_a1f1e259bc987a7e4627e3ac2cc0c96b5}{Program\+::disable\+Parse\+Options()}} for a reciprocal method that disables \mbox{\hyperlink{class_qore_1_1_program_ad59f1b6ce7adaa693086e1b858cbe896}{parse}} options; also see \mbox{\hyperlink{class_qore_1_1_program_a2d1d26dcb43d846cec1ecf926115b857}{Program\+::replace\+Parse\+Options()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_program_a8def65d25a0934417aa425c84f38b568}\label{class_qore_1_1_program_a8def65d25a0934417aa425c84f38b568}} 
\index{Qore::Program@{Qore::Program}!setScriptPath@{setScriptPath}}
\index{setScriptPath@{setScriptPath}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{setScriptPath()}{setScriptPath()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::set\+Script\+Path (\begin{DoxyParamCaption}\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path }\end{DoxyParamCaption})}



Sets (or clears) the script path (directory and filename) for the object. 


\begin{DoxyParams}{Parameters}
{\em path} & The path (directory and filename) for the current script; if the directory component is missing, then the current directory is assumed\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.setScriptPath(\textcolor{stringliteral}{"/users/test/test.q"});}
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_program_a6fda138e987e698d3c5b11294d21bcdb}\label{class_qore_1_1_program_a6fda138e987e698d3c5b11294d21bcdb}} 
\index{Qore::Program@{Qore::Program}!setThreadInit@{setThreadInit}}
\index{setThreadInit@{setThreadInit}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{setThreadInit()}{setThreadInit()}}
{\footnotesize\ttfamily bool Qore\+::\+Program\+::set\+Thread\+Init (\begin{DoxyParamCaption}\item[{\+\_\+\+\_\+7\+\_\+ code}]{init }\end{DoxyParamCaption})}



Sets a \mbox{\hyperlink{expressions_call_reference}{call reference}} or \mbox{\hyperlink{expressions_closure}{closure}} to run every time a new thread is started. 

This code can be used to initialize \mbox{\hyperlink{threading_threading_and_variables}{global thread-\/local variables}}, for example.

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_ga16d8c2b85171b6673b60b5f7d0eaf5eb}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+T\+H\+R\+E\+A\+D\+\_\+\+C\+O\+N\+T\+R\+OL}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em init} & a \mbox{\hyperlink{expressions_call_reference}{call reference}} or \mbox{\hyperlink{expressions_closure}{closure}} to run every time a new thread is started or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} to clear any thread initialization code\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if there was already user initialization code set, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.setThreadInit(sub () \{ var = 123; \});}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
the code will be run for all new threads, but is not run by this method for the current thread
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__threading__functions_gae83c32576b59a1ecfa906d9b3c3af557}{Qore\+::set\+\_\+thread\+\_\+init()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_program_a8dc5c5f1315c9b0faebf9806548d30b2}\label{class_qore_1_1_program_a8dc5c5f1315c9b0faebf9806548d30b2}} 
\index{Qore::Program@{Qore::Program}!setTimeZone@{setTimeZone}}
\index{setTimeZone@{setTimeZone}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{setTimeZone()}{setTimeZone()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::set\+Time\+Zone (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_time_zone}{Time\+Zone}}}]{zone }\end{DoxyParamCaption})}



Sets the default local time zone for the object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{TimeZone tz(\textcolor{stringliteral}{"Europe/Prague"});}
\DoxyCodeLine{pgm.setTimeZone(tz);}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_time_zone_a7e12da4b71bf101c397f06123474403f}{Time\+Zone\+::set()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_program_a5eaa38aba68af2d1884cf014d8c7c0aa}\label{class_qore_1_1_program_a5eaa38aba68af2d1884cf014d8c7c0aa}} 
\index{Qore::Program@{Qore::Program}!setTimeZoneRegion@{setTimeZoneRegion}}
\index{setTimeZoneRegion@{setTimeZoneRegion}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{setTimeZoneRegion()}{setTimeZoneRegion()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::set\+Time\+Zone\+Region (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{region }\end{DoxyParamCaption})}



Sets the default local time zone for the object from a path to a zoneinfo time zone region file. 

If there are errors opening, reading, or parsing the file (or the Windows registry entry, depending on the platform), an exception is thrown


\begin{DoxyParams}{Parameters}
{\em region} & The path to the zoneinfo file for the time zone region to set as the local time zone for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.setTimeZoneRegion(\textcolor{stringliteral}{"Europe/Prague"});}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em T\+Z\+I\+N\+F\+O-\/\+E\+R\+R\+OR} & Unable to read zoneinfo file; invalid file magic; error parsing zoneinfo file, etc \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_program_aa210b78ad95860ecc26d4489d276d180}\label{class_qore_1_1_program_aa210b78ad95860ecc26d4489d276d180}} 
\index{Qore::Program@{Qore::Program}!setTimeZoneUTCOffset@{setTimeZoneUTCOffset}}
\index{setTimeZoneUTCOffset@{setTimeZoneUTCOffset}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{setTimeZoneUTCOffset()}{setTimeZoneUTCOffset()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::set\+Time\+Zone\+U\+T\+C\+Offset (\begin{DoxyParamCaption}\item[{softint}]{seconds\+\_\+east }\end{DoxyParamCaption})}



Sets the default time zone for the \mbox{\hyperlink{class_qore_1_1_program}{Program}} object based on the number of seconds east of U\+TC; for zones west of U\+TC, use negative numbers. 

Time zones set with this method cannot have any daylight savings time information; to set a zone with daylight savings time information, use \mbox{\hyperlink{class_qore_1_1_program_a5eaa38aba68af2d1884cf014d8c7c0aa}{Program\+::set\+Time\+Zone\+Region()}} instead


\begin{DoxyParams}{Parameters}
{\em seconds\+\_\+east} & The number of seconds east of U\+TC; for zones west of U\+TC, use negative numbers\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}
The following examples are all equivalent, setting the time zone to +02 U\+TC\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.setTimeZoneUTCOffset(7200);}
\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.setTimeZoneUTCOffset(2h);}
\end{DoxyCode}
 
\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.setTimeZoneUTCOffset(PT2H);}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_time_zone_ad9b04e2df42c21fd1d67ad7b2a1e7f3f}{Time\+Zone\+::set\+U\+T\+C\+Offset()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_program_a275563ed4d95be6a9900d2966025802c}\label{class_qore_1_1_program_a275563ed4d95be6a9900d2966025802c}} 
\index{Qore::Program@{Qore::Program}!undefine@{undefine}}
\index{undefine@{undefine}!Qore::Program@{Qore::Program}}
\subsubsection{\texorpdfstring{undefine()}{undefine()}}
{\footnotesize\ttfamily nothing Qore\+::\+Program\+::undefine (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{def }\end{DoxyParamCaption})}



Unsets a \mbox{\hyperlink{conditional_parsing}{parse define}} for the current \mbox{\hyperlink{class_qore_1_1_program}{Program}}. 


\begin{DoxyParams}{Parameters}
{\em def} & The name of the define to undefine; if the given define is not defined anyway, the operation is ignored\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{pgm.undefine(\textcolor{stringliteral}{"PRODUCTION"});}
\end{DoxyCode}
 
\end{DoxyParagraph}
