ffillArray

Requires FM 1.0 Beta 9.0c (28 May 2008) or newer

Syntax

bool ffillArray (int nr, double dval)

Arguments

nr
Number of the array. Values from 0 to 99 are allowed.
dval
Floating-point value to fill the Array

Return

Returns true if successful, or false if an error occurred (e.g., incorrect value for nr or byte-size of Array).

Description

Function for filling an Array with a certain floating-point value; e.g., for initializing all elements of the Array to -0.5. The byte-size of the Array must be 2, 4, or 8. If the byte-size is 2 or 4, dval will be converted from (double)? to (half)? (16-bit) or (float)? (32-bit), resp., format before storing it in the Array.

Example

%ffp
OnFilterStart:{
	allocArray (0,100,0,0,4);
	ffillArray (0, -0.5);
	Info ("The Array was filled with the value: %g", fgetArray(0, rnd(0,99) ,0,0) );
	freeArray(0);	
	return false;
}

See Also

fillArray, allocArray, freeArray, fgetArray, fputArray, getArrayDim, copyArray

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.