Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Basic4ppc Wishlist
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?


fine tuning


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-30-2008, 08:28 AM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default fine tuning

Quote:
If PortraitIsOn = True AND LandscapeIsOn = True
ScreenIs320Square = True
A=1
End If
The above gives a compile error about then end sub ...

...but should it grumble instead about the lack of a "Then" statement on the end of the first line instead?

Also, take a look at the AND keyword ... B4P seems to uppercase this ... should it be 'And'?
Reply With Quote
  #2 (permalink)  
Old 05-30-2008, 08:53 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,455
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by badkarma View Post
...but should it grumble instead about the lack of a "Then" statement on the end of the first line instead?
In general for compilers the order in which errors are reported will depend upon how the code is parsed. Most compilers will not bomb out at the first error but will try to carry on compiling to show any further errors ignoring some code in the process. This means that some errors may be "hidden" until other errors are corrected. In this case it seems the lack of "End If" is stopping the compiler seeing the "If .. End If" structure so it doesn't look inside it to try to understand that.

Quote:
Also, take a look at the AND keyword ... B4P seems to uppercase this ... should it be 'And'?
It doesn't really matter as B4ppc is case-insensitive but a long standing convention in Basic has been to upper-case operators like AND, OR and XOR to distinguish them from variables which are usually written with at least some lower-case characters.
Reply With Quote
  #3 (permalink)  
Old 05-30-2008, 05:18 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

Excellent answer, that clears that up then.

I've often wondered about that recently about trying to compile then it gives an error "lower down" the code, then when I fix that particular error, it errors "higher up" the code....

Thanks for the explanation and education, I now know more on how things tick B4P wise. - Especially also the bit operator OR as opposed "this = x or that = y"

Cheers

Steve
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:30 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0