35 lines
706 B
Text
35 lines
706 B
Text
include "NSLog.incl"
|
|
|
|
void local fn DoIt
|
|
long a = 0, b = 0, r = 0, length, i
|
|
CFMutableStringRef string = fn MutableStringWithString( @"abracadabra" )
|
|
CFStringRef s
|
|
|
|
length = len(string)
|
|
for i = 0 to length - 1
|
|
s = NULL
|
|
select ( mid(string,i,1) )
|
|
case @"a"
|
|
a++
|
|
select ( a )
|
|
case 1 : s = @"A"
|
|
case 2 : s = @"B"
|
|
case 4 : s = @"C"
|
|
case 5 : s = @"D"
|
|
end select
|
|
case @"b"
|
|
b++
|
|
if ( b == 1 ) then s = @"E"
|
|
case @"r"
|
|
r++
|
|
if ( r == 2 ) then s = @"F"
|
|
end select
|
|
if ( s ) then mid(string,i,1) = s
|
|
next
|
|
|
|
NSLog(@"%@",string)
|
|
end fn
|
|
|
|
fn DoIt
|
|
|
|
HandleEvents
|