now THIS is extremely odd
it appears that if isn't being properly tested.
[commandLine string] contains @"-help"
- (IBAction)sendCommandLine:(id)sender
{
[command setString: [commandLine string]];
long returnval = 1;
long i = 0;
long count = [thePlugins count];
// ensure all plugins get sent the command line
NSLog(@"%@, %@, %ld, %ld",command, [thePlugins objectAtIndex: i],
[thePlugins count], returnval);
for(i = 0; i < count; i++)
{
if(![[thePlugins objectAtIndex: i] processCommand: &command])
{
returnval = 0;
}
NSLog(@"%@, %@, %ld, %ld",command, [thePlugins objectAtIndex: i],
[thePlugins count], returnval);
}
NSLog(@"%@, %ld",command, returnval);
if (returnval == 1);
{
NSLog(@"found returnval");
[command insertString: @"--> " atIndex: 0];
[command appendString: @"\r\n"];
[gameWindow setString: [[gameWindow string] stringByAppendingString:
command]];
}
NSLog(@"%@, %ld",command, returnval);
[commandLine setString: @""];
[gameWindow scrollRangeToVisible: NSMakeRange([[gameWindow string]
length] - 1, 1)];
}
log:
2010-02-27 22:14:47.323 YASSE Exerciser[3057] -help, YASSE expander.
This is the script engine AND the other added features., 1, 1
2010-02-27 22:14:47.330 YASSE Exerciser[3057]
/Users/robertde/Documents/Simutronics/Plugins/YASSE.expander/Contents/Res
ources/help.txt
2010-02-27 22:14:47.339 YASSE Exerciser[3057] -help, YASSE expander.
This is the script engine AND the other added features., 1, 0
2010-02-27 22:14:47.339 YASSE Exerciser[3057] -help, 0
2010-02-27 22:14:47.339 YASSE Exerciser[3057] found returnval
2010-02-27 22:14:47.339 YASSE Exerciser[3057] --> -help
, 0
i've tried at first with BOOL value and used YES/NO when the logs told
me it's not being processed properly. am i too tired to notice
something painfully obvious or what?
Santa Claus - 28 Feb 2010 03:26 GMT
> if (returnval == 1);
found the line. yup, something painfully obvious.
nix the semicolon at the end fixed the problem