Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Multi-dimentional Arrays?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ZeroPaladn




PostPosted: Tue Dec 12, 2006 1:12 pm   Post subject: (No subject)

Thanks guys for all your help, i got perfect! (I think i'm getting better no?) A few things though...

Silent Avenger wrote:
One thing you could do is remove the Step 1 in your for loop because the loop automatically counts up by one.

Why remove it? Sure, it doesn't do anything, but I beleive it's good coding practice (thank wtd for drilling that to most people's head with his Turing Code Streamlining thread). Might as well learn that now instead of later. Either way, if i did want to change it, i could just use the replace function to replace Step 1 with lets say... Step 1337, instead of typing it in to every for loop that requires it, its just much quicker.

wtd wrote:
code:
If temp1 = temp2 Then
    Else
        txtDisplay(counts) = Str$(busPricing(temp1, temp2))
        txtDisplay(15 - counts) = Str$(busPricing(temp2, temp1))
    End If



Ummm.... why not just the following?


code:
If temp1 <> temp2 Then
        txtDisplay(counts) = Str$(busPricing(temp1, temp2))
        txtDisplay(15 - counts) = Str$(busPricing(temp2, temp1))
    End If


Heh, never thought of that. Again, either one works, but yours is much more understandable for someone reading the code.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 16 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: