Method Help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Method Help

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    8

    Method Help

    thanks,

    I appreciate your help
    Last edited by NLS; 11-13-2005 at 03:36 AM.

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    I notice that a lot of people write returns as you have ... with a number of return statements. An instructor I greatly respect drilled into my head that, for safety, you whould provide only one return from a module. Yes, it involves the creation of a temporary variable, but one of all of those returns can slip by your view or you might forget one ... so, think about creating a temporary boolean which is initialized as false, gets changed to true only if the condition is met, then you return the value of the temporary variable ...

    But, working with your code, you need to reference the array to get the score for the week, and then you didn't add the "update score" portion of the code:
    Code:
                     if( hwScores[week] != 0 )
                     {
                           return false;
                     }
                     else
                     {
                           hwScores[week] = score;
                           return true;
    		}
    Last edited by nspils; 11-11-2005 at 04:23 PM.

Similar Threads

  1. jdi popframes method
    By caid in forum Java
    Replies: 0
    Last Post: 09-01-2005, 02:12 AM
  2. Replies: 5
    Last Post: 05-20-2002, 01:35 PM
  3. GetRows method
    By Jason West in forum VB Classic
    Replies: 1
    Last Post: 03-28-2002, 09:11 PM
  4. depricated method needs changing
    By Alan Shiers in forum Java
    Replies: 0
    Last Post: 03-15-2002, 01:51 PM
  5. Replies: 3
    Last Post: 04-13-2001, 10:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center