[futurebasic] How to use some FN from FB 4 in FB 5

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

From: Ken Shmidheiser <kshmidheiser@...>
Date: Mon, 17 Aug 2009 08:46:42 -0400
Eugen asked:

>It's any hope to use them again or something else ?


Eugen,

You can use these, but for FB 5 I would suggest you begin converting 
your code to CFStrings. There are many fine Toolbox helper functions 
that work seamlessly with CFStings.

Ken

clear local mode
local fn DeleteAllCharInTextHandle( h as Handle, search as Str15 )
'~'1
dim as Str15    replace : replace = ""
dim as Short    count
dim as Handle @ tempH
dim as OSErr    err

err = fn PtrToHand( @replace[1], tempH, replace[0] )
long if ( err = _noErr )
count = fn ReplaceText( h, tempH, search )
DisposeHandle( tempH )
end if
end fn


clear local mode
local fn FindReplaceAllInHandle( h as Handle, search as Str15, 
replace as Str255 )
'~'1
dim as Short    count
dim as Handle @ tempH
dim as OSErr    err

err = fn PtrToHand( @replace[1], tempH, replace[0] )
long if ( err = _noErr )
count = fn ReplaceText( h, tempH, search )
DisposeHandle( tempH )
end if
end fn