/*
*
* ProLinga-Run
*
* Copyright (C) 2002-2009 Xobas Software.
* All rights reserved.
*
* This file is part of ProLinga-Run.
*
* ProLinga-Run is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProLinga-Run is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProLinga-Run. If not, see .
*
* More information is available at the following addresses:
*
* Website : http://www.prolinga.org
*
* Email : prolinga-list@prolinga.org
*
*
*/
#include "RunCommon.h"
#include
#include
#include
#include "RepositoryCommand.hpp"
#include "DataRef.hpp"
#include "Logic.hpp"
#include "Limits.hpp"
extern char *exitLogicValue;
extern DataReturnPtr dataPtr;
/* Command : RETURN */
/* Syntax : RETURN [data_ref ... ] */
void CmdReturn(const char **argList, int argHits, bool isMainThread)
{
char dataRef[LM_PARAMETER_DATA_LENGTH];
int i;
/* If no arguments just return */
if (argHits == 0)
return;
/* Assign value of first exit dataref to exit var */
getDataRef(argList[1], isMainThread, dataRef, false);
if (exitLogicValue != NULL)
delete exitLogicValue;
exitLogicValue = new char[strlen(dataRef)+1];
strcpy(exitLogicValue, dataRef);
/* Assign all return values to DataReturn */
for (i = 1; i <= argHits; i++)
{
/* Put Data Ref Value */
dataPtr->putDataRefValue(&dataPtr, (i-1), argList[i]);
}
}