DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Method Help

  1. #1
    Join Date
    Oct 2005

    Method Help


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

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    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:
                     if( hwScores[week] != 0 )
                           return false;
                           hwScores[week] = score;
                           return true;
    Last edited by nspils; 11-11-2005 at 03:23 PM.

Similar Threads

  1. jdi popframes method
    By caid in forum Java
    Replies: 0
    Last Post: 09-01-2005, 01:12 AM
  2. Replies: 5
    Last Post: 05-20-2002, 12:35 PM
  3. GetRows method
    By Jason West in forum VB Classic
    Replies: 1
    Last Post: 03-28-2002, 08:11 PM
  4. depricated method needs changing
    By Alan Shiers in forum Java
    Replies: 0
    Last Post: 03-15-2002, 12:51 PM
  5. Replies: 3
    Last Post: 04-13-2001, 09: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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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