template <class T>
void GetSubVector<T>::DoIt()
{
- int i;
+ int i,iStart,iEnd;
+ bool ok = true;
+ iStart = bbGetInputI();
+ iEnd = bbGetInputI() + bbGetInputSize() - 1;
+ if ((iStart<0) || (iEnd<0)) { ok=false; }
+ if (iStart>(int)bbGetInputIn().size() ) { ok=false; }
+ if (iEnd>=(int)bbGetInputIn().size() ) { ok=false; }
+
+
+
std::vector<T> tmpVectResult;
- if ( (bbGetInputI()<(int)bbGetInputIn().size()) && (bbGetInputI()>=0) && (bbGetInputSize()>=1) )
+ if ( (ok==true) && (bbGetInputSize()>=1) )
{
- for ( i=0 ; i<bbGetInputSize() ; i++)
+ for ( i=iStart ; i<=iEnd ; i++)
{
- if ( bbGetInputI()+i<(int)bbGetInputIn().size() )
+ if ( i<(int)bbGetInputIn().size() )
{
- tmpVectResult.push_back( bbGetInputIn()[bbGetInputI()+i] );
+ tmpVectResult.push_back( bbGetInputIn()[i] );
} // if InputI+i
}// for