[futurebasic] Re: [FB] CFIndex Problem

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2009 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Mon, 27 Apr 2009 14:45:59 +1200
Ken Shmidheiser wrote:

> This code is generating a compile error. Can anyone see the error of  
> my ways?

> include "CFIndex.incl"
>
> dim as CFIndex testCFIndex
>
> fn CFIndexClear( testCFIndex  )
>
> fn CFIndexSet( testCFIndex, 0, "Black"  )
> fn CFIndexSet( testCFIndex, 1, "Brown"  )
> fn CFIndexSet( testCFIndex, 2, "Red"    )
> fn CFIndexSet( testCFIndex, 3, "Orange" )
> fn CFIndexSet( testCFIndex, 4, "Yellow" )
> fn CFIndexSet( testCFIndex, 5, "Green"  )
> fn CFIndexSet( testCFIndex, 6, "Blue"   )
> fn CFIndexSet( testCFIndex, 7, "Violet" )
> fn CFIndexSet( testCFIndex, 8, "Gray"   )
> fn CFIndexSet( testCFIndex, 9, "White"  )
>
> window 1,, (5, 45)-(360, 590)
> dim as long i
>
> print
> print "There are"; fn CFIndexGetCount( testCFIndex ); " elements in  
> testCFIndex"
> print
> print """Blue"" is the No."; fn CFIndexFind( testCFIndex, 0,  
> "Blue" ); " element in indexOne"
> print
> print "The string for testCFIndex's second element is: "; fn  
> CFIndexGet( testCFIndex, 2 )
> print fn CFIndexInsert( testCFIndex, 3, "Hey, here's an inserted  
> element" )
> print "Here are the testCFIndex elements with a new one inserted:"
> print
> for i = 0 to fn CFIndexGetCount( testCFIndex ) -1
> print "  Element No."; i; " is: "; fn CFIndexGet( testCFIndex, i )
> next i
> print
> print "Let's sort the index array:" fn CFIndexSort( testCFIndex )
> print
> for i = 0 to fn CFIndexGetCount( testCFIndex ) -1
> print "  Element No."; i; " is: ";fn CFIndexGet( testCFIndex, i )
> next i
> print
> print "Remove Element 3"
> fn CFIndexDelete( testCFIndex, 3 )
> print
> print "Repaired index array:'
> print
> for i = 0 to fn CFIndexGetCount( testCFIndex ) -1
> print "  Element No."; i; " is: ";fn CFIndexGet( testCFIndex, i )
> next i
> print
>
> do
> handleevents
> until gFBQuit


CFIndexInsert() and CFIndexSort() are procedures, not functions  
returning a value.

Robert P.