[futurebasic] All of a sudden (I don't know what happened) my programstoppedaccepting user input in the edit field

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2004 : Group Archive : Group : All Groups

From: Stu Cram <stu.cram@...>
Date: Tue, 26 Oct 2004 22:10:08 -0600
To Brian Heibert:

It's very hard to follow your program but I suspect you have opened a 
new window so the original one with the edit field is no longer 
active. That's a common reason for what you've described.

----

I'm sure you have learned a lot by working on your program. However, 
it's time perhaps to reflect and reorganize the whole thing and in 
the process, learn much more.

You have included of sample code bits and pieces from many places and 
contributors without adapting them to your program. (ex when you 
decode the 'WIN' instruction ).

Many people have given you very useful tips to simplify the work in 
your program yet you have not taken time to fix your code and the 
errors (ex. You still have the wrong # of chars with LEFT$() when 
decoding many instructions; easy ways that avoid this problem have be 
mentioned several times.)

It's time to study how programs are organized properly rather than 
just adding bits here and there with a prayer it will work. Many 
times you have done exactly the same thing several times. for example.
    Include "Tlbx SpeechSynthesis.Incl"
The above line appears many times in your work but should be only 
once, near the very start.

TAKE TIME - LOTS OF TIME - TO READ THE MANUALS AND STUDY EXAMPLES so 
you can learn to use this and other instructions properly.

MY best advice. Start over; keep it simple; plan your work first; 
then work your plan.

Tip of the day:
re:   Overall Program Structure
a)  RESOURCES ....
b)  INCLUDE ....
d)  Define global variables that are shared by several routines
       ex.	DIM  keyWord$
	DIM  runCode$$
	' etc
	END GLOBALS

e)  Create subprograms (LOCAL FNs  in FB) for each task
      Each one must be written above any others that refer to it.
       ex. 	FN setupMainWindow
	FN updateSplashWindow
	FN runUserCode  	<=== this section of your work is
			way too long. Call smaller subprograms
			for different tasks.
	FN doMenuEvent
	- and many more -

f)   Write the main program at the end to call the subprograms as needed
	- call the setup routines
	- make the ON instructions for various events
	- DO
	     HandleEvents
                     UNTIL ...

g)  Do not put instructions between the subprograms.

Many programmers find the start with the main program and then add 
the other local functions above that as the program grows and is 
tested. Sort of like building a skyscraper - start with a strong 
foundations and the added new floors on top.

--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@...