[futurebasic] Re: [FB] CFString

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2008 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Sat, 19 Jan 2008 13:28:58 -0500
Well dang. I need to learn how to copy and paste before I try to be a  
computer programmer.

Disregard the previous idiot example.

No wonder it's not working.


Ken Eggonthefaceheiser


p.s. This still looks like something's broken. We should be able to  
handle more than one CFIndex array at a time through the  
CoreFoundation functions.


include "CFIndex.incl"
include "Tlbx CFString.incl"

dim as CFIndex brainsCFIndex, dessertCFIndex

fn CFIndexClear( brainsCFIndex  )
fn CFIndex( brainsCFIndex, 0, "Robert Purves" )
fn CFIndex( brainsCFIndex, 1, "Brian Stevens" )
fn CFIndex( brainsCFIndex, 2, "Bernie Wylde"  )
fn CFIndex( brainsCFIndex, 3, "Michele Neri"  )

fn CFIndexClear( dessertCFIndex  )
fn CFIndex( dessertCFIndex, 0, "Apple pie with ice cream"          )
fn CFIndex( dessertCFIndex, 1, "Cheese cake with cherries"         )
fn CFIndex( dessertCFIndex, 2, "Banana split with pineapple"       )
fn CFIndex( dessertCFIndex, 3, "Fudge sundae with whipped cream"   )
fn CFIndex( dessertCFIndex, 4, "Chocolate cake with vanilla icing" )
fn CFIndex( dessertCFIndex, 5, "Key lime pie with strawberries"    )

window 1,, (5, 45)-(400, 400)
dim as long i

print
print "There are"; fn CFIndexGetCount( brainsCFIndex );¬
" elements in brainsCFIndex"
print "[The answer should be 4]"
print
print "There are"; fn CFIndexGetCount( dessertCFIndex );¬
" elements in dessertCFIndex"
print"[The answer should be 6]"
print
print """Michele Neri"" is the No.";¬
         fn CFIndexFind( brainsCFIndex, 0, "Michele Neri" );¬
         " element in brainsCFIndex"
print "[The answer should be 3]"
print
print "The string for brainsCFIndex's second element is: ";¬
fn CFIndex$ ( brainsCFIndex, 2 )
print "[The answer should be: Bernie Wylde]"
print
print "The string for brainsCFIndex's fourth element is: ";¬
fn CFIndex$ ( dessertCFIndex,  2 )
print "[The answer should be: Banana split with pineapple]"

do
handleevents
until gFBQuit