| 304 | } |
| 305 | |
| 306 | void ListVariables(asIScriptEngine *engine) |
| 307 | { |
| 308 | asUINT n; |
| 309 | |
| 310 | // List the application registered variables |
| 311 | cout << "Application variables:" << endl; |
| 312 | for( n = 0; n < (asUINT)engine->GetGlobalPropertyCount(); n++ ) |
| 313 | { |
| 314 | const char *name; |
| 315 | int typeId; |
| 316 | bool isConst; |
| 317 | engine->GetGlobalPropertyByIndex(n, &name, 0, &typeId, &isConst); |
| 318 | string decl = isConst ? " const " : " "; |
| 319 | decl += engine->GetTypeDeclaration(typeId); |
| 320 | decl += " "; |
| 321 | decl += name; |
| 322 | cout << decl << endl; |
| 323 | } |
| 324 | |
| 325 | // List the user variables in the module |
| 326 | asIScriptModule *mod = engine->GetModule("console"); |
| 327 | if( mod ) |
| 328 | { |
| 329 | cout << endl; |
| 330 | cout << "User variables:" << endl; |
| 331 | for( n = 0; n < (asUINT)mod->GetGlobalVarCount(); n++ ) |
| 332 | { |
| 333 | cout << " " << mod->GetGlobalVarDeclaration(n) << endl; |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | void ListFunctions(asIScriptEngine *engine) |
| 339 | { |
no test coverage detected