Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

List manipulation methods

Method

arrayByAddingInteger:inArray:

Summary

Increment each of the values in a list of integers by anInteger. Provide a negative value to decrement the values

Signature

+ (NSArray *)arrayByAddingInteger:(NSNumber *)anInteger inArray:(NSArray *)arrayOfIntegers

Parameters

anInteger = an integer to add to each value

arrayOfIntegers = an array or list of integers to increment

Result

An array of integers

Availability

Version 1.0.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set anInteger to 10

set arrayOfIntegers to {1, 2, 3, 4, 5}

set theResult to current application's SMSForder's arrayByAddingInteger:anInteger inArray:arrayOfIntegers

ASify from theResult

--> {11, 12, 13, 14, 15}

theResult as list

--> {11, 12, 13, 14, 15}


set anInteger to -10

set theResult to current application's SMSForder's arrayByAddingInteger:anInteger inArray:arrayOfIntegers

ASify from theResult

--> {-9, -8, -7, -6, -5}

theResult as list

--> {-9, -8, -7, -6, -5}


Click here to open script in a script editor