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

Username:   Password: 
 RegisterRegister   
 my program just wont clear screen
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Michael




PostPosted: Thu Oct 05, 2006 6:18 pm   Post subject: my program just wont clear screen

im sure this shouldnt be too hard to fix..
im sorry i had to put this file in a zip because there are so many pics..

when u click on question1.. it goes to the question but it just wont cls
i dont understand whats wrong

look in the mainline..

code:


    if x > 99 and x < 201 and y > 239 and y < 270 and button = 1 then
        cls
        question1
    end if




question1 is a procedure..

if i get rid of the procedures and do something like


code:


 if x > 99 and x < 201 and y > 239 and y < 270 and button = 1 then
        cls
        put "blah"
        exit
    end if


then it works
but i gotta use procedures

i tried clsing the actuall procedure... exit statements and what not .. nothing works



program.zip
 Description:
The program

Download
 Filename:  program.zip
 Filesize:  160.68 KB
 Downloaded:  139 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
shoobyman




PostPosted: Thu Oct 05, 2006 6:31 pm   Post subject: (No subject)

you probably forgot to put a view.update as usual
Michael




PostPosted: Thu Oct 05, 2006 6:50 pm   Post subject: (No subject)

why dont u check the program first......................
shoobyman




PostPosted: Thu Oct 05, 2006 6:56 pm   Post subject: (No subject)

y don't you make me? Twisted Evil
shoobyman




PostPosted: Thu Oct 05, 2006 7:00 pm   Post subject: (No subject)

when you set the View.Set ("graphics:400;400"), it acts like the setscreen ("offscreenonly") thing, so you did have to put a View.Update

try it
Michael




PostPosted: Thu Oct 05, 2006 7:13 pm   Post subject: (No subject)

well the view.update is already there ..

the problem is that i should put offscreenonly in a seperate command... that might work.. i'll try iy when i get back 2 my computer


see private message
LaZ3R




PostPosted: Thu Oct 05, 2006 10:23 pm   Post subject: (No subject)

You have to stick a bunch of View.Updates in your program because you're using the setscreen ("offscreenonly") which simply does all the graphics stuff offscreen... only... and then you need to call the program to bring up the graphics and text.

I see no view updates in the right place. You have to put it inside, everywhere after all the graphics and text have been called out, but also before the program requires user input. I'll help you tomorrow in class :p.
Clayton




PostPosted: Thu Oct 05, 2006 10:36 pm   Post subject: (No subject)

LaZ3R wrote:

You have to stick a bunch of View.Updates in your program...


no, no, no, and no again, your program should only ever have one (maybe two for humongous programs) View.Update in it. That being said, even inserting the View.Update(s) will not help your program, i think that it may have something to do with your Pic.ScreenLoad(ing) statements (which you should probably use Pic.New and Pic.Draw for instead, as it is mucho grande faster).
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Thu Oct 05, 2006 10:37 pm   Post subject: (No subject)

LaZ3R wrote:

You have to stick a bunch of View.Updates in your program...


no, no, no, and no again, your program should only ever have one (maybe two for humongous programs) View.Update in it. That being said, even inserting the View.Update(s) will not help your program, i think that it may have something to do with your Pic.ScreenLoad(ing) statements (which you should probably use Pic.New and Pic.Draw for instead, as it is mucho grande faster).

Look into the Turing Walkthrough for some excellent quality tuts written by members here, take a good look at the Picture tut and the View.Set and View.Update tutorial
BenLi




PostPosted: Fri Oct 06, 2006 8:26 am   Post subject: (No subject)

Quote:
You have to stick a bunch of View.Updates in your program because you're using the setscreen ("offscreenonly")


Yeah I agree with freakman, the whole point of offscreenonly is to refresh only once for everytime you draw the whole screen. spamming View.Update doesn't do anything

Also its a stylistic issue. In large programs, you should organize everything into subroutines and put those in a loop and only View.Update in the main loop. Also, following this style you should have as little global variables as possible
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  [ 10 Posts ]
Jump to:   


Style:  
Search: