944,047 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1163
  • C++ RSS
May 13th, 2006
0

sequencer

Expand Post »
hi there im having some problems, im trying to write a simple software sequencer in visual C++ under windows. I have a few problems my first two menus open up fine but the third wont open it just loops on the title menu. The second probelm i have is that all the sections dont play together any help would be great cheers ontrix code attached
Attached Files
File Type: txt code.txt (24.5 KB, 32 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ontrix is offline Offline
6 posts
since Apr 2006
May 13th, 2006
0

Re: sequencer

You really need to discover the magic of
a) indentation
b) functions.

A 800+ lines of code in main(), c'mon be serious.
Nobody is going to wade through that lot just to spot what might be wrong.

A rough rule of thumb - if you can't see the entire function on screen at the same time (from it's opening brace to it's closing brace), then it's probably too big to manage.

I bet all those header files have code inside them as well right?

How about a separate function for each top-level menu choice.

>> snipped from the code...
C++ Syntax (Toggle Plain Text)
  1. float edit_instrument1[5]; //edit the instrument for a note
  2. Instrmnt *instrument1 = 0; // This variable will hold the instrument information
  3. // snip
  4. float edit_instrument2[5]; //edit the instrument for a note
  5. Instrmnt *instrument2 = 0; // This variable will hold the instrument information
Why isn't this screaming at you to be
a) a struct containing several things
b) an array of that struct.
That would cut down significantly on the number of variables you have.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: pls help
Next Thread in C++ Forum Timeline: print out the solve word puzzle





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC