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

Username:   Password: 
 RegisterRegister   
 A few questions bout my program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dphearnz




PostPosted: Fri Nov 17, 2006 10:45 am   Post subject: A few questions bout my program

what code can i use to make sure the program doesnt run off the screen, like if im listing something thats longer that the screen size, it runs off and you cant see whats at the top.

and you know how you can use :* so that a space can be recognized in a string, well is there a similar command that makes letters recongnized in an integer or a real number? so that the program wont crah...

and can i change the size of the output font?

and if im playing music in my program, how can i make it play WHILE the program runs, instead of before or after?

hehehe...this is so n00b of me..
THANKS
Sponsor
Sponsor
Sponsor
sponsor
NikG




PostPosted: Fri Nov 17, 2006 11:01 am   Post subject: (No subject)

Slow down there buddy.
First, ppl here don't like "help me" titled posts on this site. Even saying "A few simple questions" would have been better. Keep that in mind.
Second, what's with the centred/bolded font?

Now I'll try and help:

- You first question wasn't very clear. Can you give an example (code would be particularly useful)

- There's no way to let integer variables contain strings because... well it makes no sense! If you need to validate the user's input, try using a string variable to collect the input and using the strintok function on it before saving it to an int variable.

- You can change the size of the output font. Research Font.Draw

- I believe the Music.PlayFileLoop or PlayFileReturn (or something like that) will help.
[Gandalf]




PostPosted: Fri Nov 17, 2006 4:29 pm   Post subject: Re: A few questions bout my program

dphearnz wrote:
what code can i use to make sure the program doesnt run off the screen, like if im listing something thats longer that the screen size, it runs off and you cant see whats at the top.

Put:
code:
setscreen ("text")

At the top of your code. Note that you cannot use this in conjunction with any Draw.*, draw*, or colour commands. To do this, you will have to set the mode once again to graphics mode by putting:
code:
setscreen ("graphics")
Prince Pwn




PostPosted: Fri Nov 17, 2006 11:14 pm   Post subject: (No subject)

In relation to his question, without putting it in text mode, can you use GUI.ScrollBar or something similar? I don't like using the GUI, so I am unsure how to properly use ScrollBar. I attempted to follow the Turing Help Docs but I don't know how to increase the scrolling when you add more graphical text, if that makes any sense. The Help only shows how to show the position of the scroll bar.
Cervantes




PostPosted: Sat Nov 18, 2006 11:17 am   Post subject: (No subject)

Moved to [Turing Help].

Most of the questions have been answered, but I'll offer some advice for the first one. View.Set("text") is a nice way to solve the problem, but if you insist on having pretty graphics, you'll have to do some more work. You'll have to calculate how many rows are on the screen (maxrow) and output that many lines at a time, pausing for keystrokes before continuing. That's at the very least. If you want to go further, you could keep an array of the lines you're outputting (or just recalculate them as you go) and allow for the up and down arrows to scroll through what's output. This wouldn't be too hard either.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: