[futurebasic] C array garbage value

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2017 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Fri, 10 Feb 2017 21:20:05 -0500
A very wise, but bashful, FBer sent me this back channel.

I tested it without error in Sierra.

Ken


include "NSLog.incl"

BeginCFunction
long MyFunction1( long count )
{
 long dim[count];
 for ( long d = 0; d < count; d++ )
 {
     dim[d] = 17 * d;
     NSLog(@"Entry %li = %li", d, dim[d]);
 }

 long d = dim[6];   // garbage value ?????
 NSLog(@"\rValue of array entry 6 is: %li",d);

return d;
}
EndC
toolbox fn MyFunction1( long ) = long

fn MyFunction1( 10 )

RunApplicationEventLoop()