Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.

Head/Tail and Left/Right CrossWind Widget

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-22-2010, 06:22 AM
Knows the basics
 
Join Date: Jan 2010
Posts: 51
Default Head/Tail and Left/Right CrossWind Widget

Hello...I'm an absolute newbie in Programming.Been looking at basic4ppc last couple of days and found it quite interesting. A few of you have been very kind to Help too.
I made a small prog for Aviation enthusiasts.I'm an Airbus Pilot and it helps me find the correct wind component to calculate my Aircraft's Performance for Landing/TakeOff. Hope it helps at least one of you!
Of course,its very basic for most of you.

Cheers...Harinder(Harry)
Attached Files
File Type: sbp WindWidget.sbp (2.6 KB, 54 views)
Reply With Quote
  #2 (permalink)  
Old 01-22-2010, 09:23 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by harry5568 View Post
I'm an Airbus Pilot
Wow! A318 or A380?
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 01-22-2010, 01:58 PM
Knows the basics
 
Join Date: Jan 2010
Posts: 51
Default

Quote:
Originally Posted by agraham View Post
Wow! A318 or A380?
hi agraham...well..m flying the a320..recession has hit aviation big time..companies have canceled orders for 380..guess i'll have to wait my turn..
cheers..harry
Reply With Quote
  #4 (permalink)  
Old 01-22-2010, 02:35 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Good habits are best established early in programming (as in life!)

I haven't changed your actual code at all but look how the use of tabs to indent lines reveals the structure in the code and makes it easier to read, particularly when you have nested constructs like Sub/End Sub, If/End If, For/Next, Do/While. You can adjust the amount of indent in the IDE for each tab character by Tools -> IDE Options -> TabSize

Code:
Sub headortail
   a=ComboBox1.Text
   b = TextBox1.Text
   c = Num1.Text
   e=
Cos(((a*10)-b)*(22/(7*180)))*c
   
If  Round(e)<0 Then
      Label11.FontColor= cRed
      Label2.FontColor= cRed
      
Return "TAIL"
   
Else If Round(e)=0 Then
      
Return " "
   
Else
      Label11.FontColor= cBlack
      Label2.FontColor= cBlack
      
Return "HEAD"
   
End If
End Sub
Another tip. Unless you need to return a string with a space character as in the code above you can just use Return on it's own which does in fact return an empty string.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 01-22-2010, 04:46 PM
Knows the basics
 
Join Date: Jan 2010
Posts: 51
Default

thanks agraham..i'll remember your vary handy tips....harry
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Application's left overs ? derez Questions (Windows Mobile) 4 01-20-2010 07:14 PM
Left & right soft keys on WM smartphone jcac101 Questions (Windows Mobile) 1 02-19-2009 04:16 PM
Left() and Right() JesseW Basic4ppc Wishlist 6 10-18-2008 06:58 AM
Beeting Head Against a wall bish0p Questions (Windows Mobile) 0 09-11-2008 04:19 PM


All times are GMT. The time now is 04:40 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0