|
<< Index >> |
FutureBasic |
BeginCFunction | statement | |
|
BeginCFunction
// the translator passes everything, except comments, untranslated to the compiler
// the C code, typically a function definition, goes before main()
EndC
// declarations of all kinds (these go in *.h)
BeginCDeclaration
void
FooBeep();
EndC
// definitions of functions and global vars (these go in *.c)
BeginCFunction
void FooBeep()
{
SysBeep( 1 );
}
EndC
toolbox FooBeep // declare symbol for the translator
// declarations of all kinds (these go in *.h)
BeginCDeclaration
extern const CFStringRef kFooVersionString;
EndC
// definitions of functions and global vars (these go in *.c)
BeginCFunction
const CFStringRef kFooVersionString = CFSTR( "1.3" );
EndC
system CFStringRef kFooVersionString // declare symbol for the translator
// declarations of all kinds (these go in *.h)
BeginCDeclaration
@interface FooThing : NSObject {
NSWindow *window;
}
- (void)buildWindow;
@end
void BuildWindow( void );
EndC
// definitions of functions and global vars (these go in *.m)
BeginCFunction
@implementation FooThing
- (void)buildWindow {
window = [[NSWindow alloc] initWithContentRect:NSMakeRect( 0, 0, 300, 300 )
styleMask:NSTitledWindowMask
backing:NSBackingStoreBuffered defer:NO];
[window center];
[window setTitle:@"FooThing"];
[window makeKeyAndOrderFront:nil];
}
@end
void BuildWindow( void )
{
FooThing *ft = [[FooThing alloc] init];
[ft buildWindow];
[ft release];
}
EndC
// declare symbols for the translator
toolbox BuildWindow
BuildWindow
HandleEvents
See also
BeginCCode; BeginCDeclaration; EndC