Compiled Home Pages




Anonymous classes are used with the mysql_list and mysql_cursor command.
With mysql_list and mysql_cursor, you specify the database procedure call, the input variables, and the output data structure.
mysql_list (database_connection,command_sql,Context,input_variables) {output data structure}
mysql_list (database_connection,command_sql,Context,input_variables) new_class_name {output data structure}
Examples:
mysql_list $list ($db,"CALL usp_GetData(?,?)",Context,int $userID,varchar100 $userName) { int $DataID;varchar100 $Name;DataTime $LastModified};
mysql_list $list ($db,"CALL usp_GetData(?,?)",Context,int $userID,varchar100 $userName) DataInput { int $DataID;varchar100 $Name;DataTime $LastModified};
If you don't specify a new_class_name, an anonymous class is created. You can specify a class name to define a new class. Anonymous classes are good for if you want to fetch data and process it in the same function.
Specifying the class name is good for if you want to create a function that returns a specific class type.
Anonymous classes are compiled in anonymous_classes.h and anonymous_classes.cpp.
You can create an anonymous class with a name by using the Struct command.
You use the Struct command inside any function. But the scope is the entire project.
Example: Struct CompanyAverage {varchar100 $CompanyName;int $StoryCount;int $Score;varchar50 $StateAbbreviation};
// Create on the stack.
CompanyAverage $companyAverageOnStack;
// Create on the heap.
CompanyAverage *$companyAverageOnHeap = new CompanyAverage();
// Create on the web heap that is deleted when the web page finishes rendering. CompanyAverage *$companyAverageOnWebHeap = CompanyAverage::Create(Context);

Anonymous classes support: Variables created with mysql_cursor inherit from MySqlCursor.
They support the following built-in methods: