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

Username:   Password: 
 RegisterRegister   
 Always on top
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
J-MoNeY




PostPosted: Fri May 26, 2006 11:49 pm   Post subject: Always on top

Is there anyway I could make the Turing Run Window always stay on top? Also is there a way to make it so that the Run window won't be able to be closed until the program has finished executing?
Sponsor
Sponsor
Sponsor
sponsor
TheOneTrueGod




PostPosted: Sat May 27, 2006 1:12 am   Post subject: (No subject)

I believe the only way to keep it on top all the time is to do a "setfocus" constantly, but why would you need to? Also, the closing thing is an option when you compile it. It sounds to me like your making a "virus" though...
J-MoNeY




PostPosted: Sat May 27, 2006 10:32 am   Post subject: (No subject)

I'm trying to make an animation and I like to program while I watch the run window to see for any errors or glitches so the having the run window always on top comes in handy. How would I make a timer say for about 30 seconds ?
TheOneTrueGod




PostPosted: Sat May 27, 2006 10:43 am   Post subject: (No subject)

Time.Elapsed would be the easiest method.

code:

var i : int
loop
   i := Time.Elapsed div 1000
end loop


This will return the number of seconds that have elapsed. Time.Elapsed returns the number of milliseconds since the program started. Use it with an exit when statement, and you'll have a loop that runs for aproximately however much time you want it to (I don't think theres any way to get it so it stops EXACTLY at 30 seconds, because you'll allways be off by a couple of milliseconds due to processing time.)
upthescale




PostPosted: Sat May 27, 2006 2:58 pm   Post subject: (No subject)

liek this also:

code:

setscreen ("offscreenonly;graphics:600;500;position:truemiddle;center;nobuttonbar")
var i : int
var font : int := Font.New ("arial:20")
loop
    colorback (7)
    cls
    i := Time.Elapsed div 1000
    Font.Draw ("Time: " + intstr (i), 250, maxy div 2, font, red)
    View.Update
end loop
upthescale




PostPosted: Sat May 27, 2006 3:00 pm   Post subject: (No subject)

wont let me edit...make graphics isntead of w/e it is, to 200,500 so it will go on top!
Cervantes




PostPosted: Sat May 27, 2006 4:14 pm   Post subject: (No subject)

upthescale wrote:

code:

setscreen ("offscreenonly;graphics:600;500;position:truemiddle;center;nobuttonbar")
var i : int
var font : int := Font.New ("arial:20")
loop
    colorback (7)
    cls
    i := Time.Elapsed div 1000
    Font.Draw ("Time: " + intstr (i), 250, maxy div 2, font, red)
    View.Update
end loop

What is the purpose of the 'i' variable? It does nothing except store the value of Time.Elapsed div 1000, and you only use that value once -- when drawing it. Thus, you don't need that variable. Move the Time.Elapsed div 1000 directly into the Font.Draw line.
code:

var font : int := Font.New ("arial:20")
loop
    colorback (7)
    cls
    Font.Draw ("Time: " + intstr (Time.Elapsed div 1000), 250, maxy div 2, font, red)
    View.Update
end loop
Clayton




PostPosted: Sat May 27, 2006 6:44 pm   Post subject: (No subject)

upthescale wrote:
wont let me edit...make graphics isntead of w/e it is, to 200,500 so it will go on top!


no,no,no, and no. the most simple way would be to use View.Set and the "position:x;y" command ex.
Turing:

var x,y:int
x:=500
y:=300
View.Set("graphics:"+intstr(x)+";"+intstr(y)+",position:"+intstr(max-x)+";"+intstr(max-y))


NOTE:*the above code is untested, but a similiar idea can be used to do this Very Happy*[/code]
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: