[F-Script-talk] Re: Clearing console and loading code into a block
Brought to you by:
pmougin
From: Philippe M. <pm...@ac...> - 2004-02-21 17:13:27
|
Le 21 f=E9vr. 04, =E0 14:14, Philippe de Rochambeau a =E9crit : > is there a way to clear the console in FScript? No easy way to do that. > Could code contained in a text file be loaded in a FScript block using=20= > Cocoa? Sure. For instance, I have a text file named "block.txt" stored on my=20 desktop, containing the source code of a block. I turn it into a block=20= in F-Script by loading it into an NSString and creating a block using=20 the "blockFromString:" method defined in class System. Example (in=20 F-Script): sys blockFromString: (NSString=20 stringWithContentsOfFile:'/Users/pmougin/Desktop/block.txt') If you don't have a System instance at hand (for example, suppose=20 you're doing this directly from Objective-C instead of F-Script), you=20 can use the "asBlock:" method defined in FSNSString (a category of=20 NSString provided by F-Script). Example (in Objective-C): [[NSString=20 stringWithContentsOfFile:@"/Users/pmougin/Desktop/block.txt"] asBlock] Best, Philippe Mougin= |