I want to use Option.TargetDevice in a preprocessor directive.
e.g. #If (Left(Option.TargetDevice,4) = "ZX24")
Since the pin assignments (like the LEDs) are the same within the ZX24 family, I do not need to know if it is an -A, -AE, -N, etc. (at least I think all the pin assignments are the same withing the family)
I get successful compilation if I do not use the Left() function and just check the entire Option.TargetDevice string, but I want to simplify by using the Left() function. Is there some way to extract the first 4 characters in the preprocessor directive?
-Tony
Preprocessor directive
Re: Preprocessor directive
Not directly. As you've discovered, ZBasic System Library functions currently can't be used in the conditional expressions. A "trick" that might serve your purposes is:spamiam wrote:Is there some way to extract the first 4 characters in the preprocessor directive?
Code: Select all
#if (Option.TargetDevice >= "ZX24") And (Option.TargetDevice < "ZX25")
- Don Kinzer