The JADE 2022 release meets tomorrow’s business demands.
HistoricalComments
Brian Johnstone 24/05/2018 5:41:40 PM
@James - you can create your own 'multiple parameter' methods by using the 'ParamListType' pseudo type. For example, the following code would implement an 'includesOneOf' method which takes one or more parameters to match against - once again the formatting will get corrupted in this comment: ************************************************************************** includesOneOf( pStrings : ParamListType ) : Boolean ; vars paramListCount : Integer ; paramIndex : Integer ; nextEntry : Any ; begin paramListCount := app.getParamListTypeLength( pStrings ); foreach paramIndex in 1 to paramListCount do nextEntry := app.getParamListTypeEntry( paramIndex, pStrings ); if not nextEntry.isKindOf( String ) then // For real 'production ready code' it should probably raise an "invalid parameter type" exception continue ; endif; if self.pos( nextEntry.String, 1 ) > 0 then return true ; endif; endforeach; return false ; end; ************************************************************************** Brian Johnstone 24/05/2018 5:32:57 PM @Sam - unless this code is being called thousands/millions of times, I'd take the improved readability over the additional method call every time. ie: Method calls aren't that expensive most of the time, and people should avoid the urge for doing premature optimisation until they actually have a performance issue. James Burnby 24/05/2018 9:23:20 AM I would see great benefit here if it took multiple parameters, similar to isOneOf. e.g. if status.includesOneOf?("UAT,"Test"). |