Decision statements with strings?
I was wondering if this is possible, because for some reason I can't get it to work.
new Arg[32] read_argv(1, Arg, 31) if(Arg == 'string') { Do this } else { Do this } Am I doing something wrong in my code? The error it gives me is: Array must be indexed (variable "Arg") Thanks =] |
Re: Decision statements with strings?
PHP Code:
|
Re: Decision statements with strings?
What atomen is showing you is that you cannot compare strings with the == operator. You use the equal(), equali() or strcmp() functions.
For your example is would be: new Arg[32] read_argv(1, Arg, 31) if(equali(Arg, "string")) { Do this } else { Do this } |
| All times are GMT -4. The time now is 03:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.