Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
identifying the target CPU?

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
spamiam



Joined: 13 Nov 2005
Posts: 665

Posted: 24 October 2006, 20:06 PM    Post subject: identifying the target CPU? Reply with quote

I want to try to use compiler pre-processor commands for conditional compilation. Namely identifying different pins on different CPU platforms.

I use option targetcpu ....

But I also want to be able to say

#If TargetCPU = ZX44
some commands
#else
other commands
#endif


I looked for something like register.TargetCPU, but that does not exist.

I can not use the #If.... as written above. It needs to be a numerical value on the right of the equals....


So, what do I do?

-Tony
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 24 October 2006, 20:16 PM    Post subject: Re: identifying the target CPU? Reply with quote

spamiam wrote:
I also want to be able to say
Code:
#if TargetCPU = ZX44
    some commands
#else
    other commands
#endif

Use Option.TargetCPU.
Code:
#if Option.TargetCPU = "ZX44"
    some commands
#else
    other commands
#endif


Last edited by dkinzer on 24 October 2006, 20:27 PM; edited 1 time in total
Back to top
stevech



Joined: 23 Feb 2006
Posts: 657

Posted: 24 October 2006, 20:17 PM    Post subject: Reply with quote

I've used

#if option.TargetCPU = "ZX24a"
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 665

Posted: 24 October 2006, 22:39 PM    Post subject: Reply with quote

AHHH, perfect! Thanks.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group