!load a specified script @param sFileName path of the script that has to be loaded */
| 321 | @param sFileName path of the script that has to be loaded |
| 322 | */ |
| 323 | int CScriptObjectScript::LoadScript(IFunctionHandler *pH) |
| 324 | { |
| 325 | bool bReload = false; |
| 326 | bool bRaiseError = true; |
| 327 | |
| 328 | if (pH->GetParamCount() >= 3) |
| 329 | { |
| 330 | pH->GetParam(3, bRaiseError); |
| 331 | } |
| 332 | if (pH->GetParamCount() >= 2) |
| 333 | { |
| 334 | if (pH->GetParamType(2) == svtNumber) |
| 335 | { |
| 336 | int iReload; |
| 337 | |
| 338 | if (pH->GetParam(2, iReload)) |
| 339 | { |
| 340 | bReload = (iReload != 0); |
| 341 | } |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | const char *sScriptFile; |
| 346 | pH->GetParam(1,sScriptFile); |
| 347 | |
| 348 | if (m_pScriptSystem->ExecuteFile(sScriptFile, bRaiseError, bReload)) |
| 349 | return pH->EndFunction(1); |
| 350 | else |
| 351 | return pH->EndFunctionNull(); |
| 352 | } |
| 353 | |
| 354 | /*!unload script from the "loaded scripts map" so if this script is loaded again |
| 355 | the Script system will reloadit. this function doesn't |
nothing calls this directly
no test coverage detected