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

Username:   Password: 
 RegisterRegister   
 Help with Input.Flush
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
StarGateSG-1




PostPosted: Mon Jul 11, 2005 11:01 am   Post subject: Help with Input.Flush

Hello, Vacation is a wonderful thing, unforunatly it can't last, anyways, as the title states this is a problem with Input.Flush that has been driving me crazy for a while. Well here it is...

Ok, so it is a Input.KeyDown based menu and using View.Update to hide the wondow with the execution is finished. The problem is that when you exit after just stay on the main menu, everything works fine, but say if you go to options and then back again, it will when you hit exit have the error of keyboard input not allowed from invisible window is not allowed, this error makes sense in all logic expect it only happens after going to another procedure, but if you stay in the MainScreen all works fine. It would be really great to get input on this, I know it is vacation, but I really need to get this done. I will post the program.



Dark Tides-The Beginning.t
 Description:
This is the program, please do not copy it for your own uses, but if you would like idea's other than names and such go ahead.

Download
 Filename:  Dark Tides-The Beginning.t
 Filesize:  11.54 KB
 Downloaded:  125 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Mon Jul 11, 2005 12:48 pm   Post subject: (No subject)

I don't see why you're using Input.Flush() here. I can understand that you're moving from menu to menu, so you won't want the buffered 'Enter's to carry over...in that case you would want to use Input.Flush() in tandem with some delay()'s, otherwise they won't be all that effective.

Now, as for your problem, methinks you're loops are not exitting correctly. You have some rather odd exit conditions, but hey, as long as you know what's going on.
I don't see what the use of turing your window invisible would be...if you want the window to close when you exit...well, you can do that from the compiler menu.

As a note, I don't like the call of MainScreen from withing Intro. You should keep those calls seperate. By having that call, you link the two together...though this isn't necassarily bad in this situtation, it does mean you have that much less control. Just the whole idea of making sure each object has as little knowledge of the outside world as possible. Here, Intro knows that MainScreen exists...though the two should be independant elements.

Oh, and why such an ominous name?! [sigh], it's a fallacy of RPG's.
StarGateSG-1




PostPosted: Mon Jul 11, 2005 3:29 pm   Post subject: (No subject)

Thank you, I have taken this over from my friend who stopped working on it so soon into it, but he gave me most of the notes so the code isn't mine yet and I haven't completed the change over yet, I though I would have some fun over the summer, around my other summer projects. And what do you mean funny exits??
[Gandalf]




PostPosted: Mon Jul 11, 2005 5:54 pm   Post subject: (No subject)

code:
exit when message.Creator (i) = " "

code:
exit when Color.Options = 12

Don't know, they are pretty different though.

Also, you might want to take out the extraoneous comments. No need to say what the code already tells us.

On a side note, I don't like the use of 'forward' - it seems like pointless code to me.

Delos, RPG's are all about dark and evil names!!
"Bloody Currents and Acid Skies" hehe, I have an amazing creative mind Smile.
Delos




PostPosted: Mon Jul 11, 2005 6:03 pm   Post subject: (No subject)

In this particular case, perhaps the forwards are redundant, but in the system that he is making - a menu with circular dependance, they are vital.
Believe me, Turing's inability to use a procedure that is declared after its call can be irritating at best.
StarGateSG-1




PostPosted: Mon Jul 11, 2005 7:12 pm   Post subject: (No subject)

I don't quite get what you mean with the exits yet, the first one exits the loop when the whole message has been displayed, and the second one is more complex, I highlight the color of the active option and check the color to move it and decide which the user has chosen, that was so I didn;t have lots of variables that had to be enabled and disabled, it is a fast and very effective way to check the menu, there are similar methods used like that in basic C++ games. I tend to over comment and I am not counting lines here, if I use a few extra bits that fine by me, I put them in for quick access, makes it easy to find places when you have comments.
On the forwards, te only other way would be to have a different files for each one, or group that relies on each other, but then you have to organize so many, and without say a C++ organization system it gets hard. I total agree with Delos about turing problems, but sometimes it is nice to slip back into the old grove, I mean I mainly use C++ to advance my knowledge, but this is simple and if you know what you are doing you can do great things.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: