@@ -1664,10 +1664,10 @@ BaseGDL*& EnvT::GetPar(SizeT i)
1664
1664
/* *
1665
1665
* @brief converts par if necessary and sets 'scalar' to Long . Chokes on !NULL, NULL and non-scalar
1666
1666
*/
1667
- void EnvBaseT::AssureLongScalarPar ( SizeT pIx, DLong64& scalar)
1667
+ void EnvBaseT::AssureLongScalarPar ( SizeT pIx, DLong64& scalar, bool throwIfConversionErrorOccured )
1668
1668
{
1669
1669
BaseGDL* p = GetParDefined ( pIx);
1670
- DLong64GDL* lp = static_cast <DLong64GDL*>(p->Convert2 ( GDL_LONG64, BaseGDL::COPY));
1670
+ DLong64GDL* lp = static_cast <DLong64GDL*>(p->Convert2 ( GDL_LONG64, throwIfConversionErrorOccured?BaseGDL::COPY_THROWIOERROR: BaseGDL::COPY));
1671
1671
Guard<DLong64GDL> guard_lp ( lp);
1672
1672
if ( !lp->Scalar ( scalar))
1673
1673
Throw (" Parameter must be a scalar or 1 element array in this context: " +
@@ -1676,10 +1676,10 @@ void EnvBaseT::AssureLongScalarPar( SizeT pIx, DLong64& scalar)
1676
1676
/* *
1677
1677
* @brief converts par if necessary and sets 'scalar' to Long . Chokes on !NULL, NULL and non-scalar
1678
1678
*/
1679
- void EnvBaseT::AssureLongScalarPar ( SizeT pIx, DLong& scalar)
1679
+ void EnvBaseT::AssureLongScalarPar ( SizeT pIx, DLong& scalar, bool throwIfConversionErrorOccured )
1680
1680
{
1681
1681
BaseGDL* p = GetParDefined ( pIx);
1682
- DLongGDL* lp = static_cast <DLongGDL*>(p->Convert2 ( GDL_LONG, BaseGDL::COPY));
1682
+ DLongGDL* lp = static_cast <DLongGDL*>(p->Convert2 ( GDL_LONG, throwIfConversionErrorOccured?BaseGDL::COPY_THROWIOERROR: BaseGDL::COPY));
1683
1683
Guard<DLongGDL> guard_lp ( lp);
1684
1684
if ( !lp->Scalar ( scalar))
1685
1685
Throw (" Parameter must be a scalar or 1 element array in this context: " +
@@ -1688,16 +1688,16 @@ void EnvBaseT::AssureLongScalarPar( SizeT pIx, DLong& scalar)
1688
1688
/* *
1689
1689
* @brief converts par if necessary and sets 'scalar' to Long . Chokes on !NULL, NULL and non-scalar
1690
1690
*/
1691
- void EnvT::AssureLongScalarPar ( SizeT pIx, DLong64& scalar)
1691
+ void EnvT::AssureLongScalarPar ( SizeT pIx, DLong64& scalar, bool throwIfConversionErrorOccured )
1692
1692
{
1693
- EnvBaseT::AssureLongScalarPar ( pIx, scalar);
1693
+ EnvBaseT::AssureLongScalarPar ( pIx, scalar, throwIfConversionErrorOccured );
1694
1694
}
1695
1695
/* *
1696
1696
* @brief converts par if necessary and sets 'scalar' to Long . Chokes on !NULL, NULL and non-scalar
1697
1697
*/
1698
- void EnvT::AssureLongScalarPar ( SizeT pIx, DLong& scalar)
1698
+ void EnvT::AssureLongScalarPar ( SizeT pIx, DLong& scalar, bool throwIfConversionErrorOccured )
1699
1699
{
1700
- EnvBaseT::AssureLongScalarPar ( pIx, scalar);
1700
+ EnvBaseT::AssureLongScalarPar ( pIx, scalar, throwIfConversionErrorOccured );
1701
1701
}
1702
1702
/* *
1703
1703
* @brief converts ix if necessary and sets 'scalar' to Long . scalar unchanged if !NULL, NULL. Chokes on non-scalar
0 commit comments