none
How to count time 1 by 1 in Small Basic? RRS feed

  • Question

  • Hello. I want to know how to count and show on a GraphicsWindow, time 1 by 1. In the background (although not), a digital chronometer. Just I ask how to do this. Thank you ;)
    Monday, December 9, 2013 12:13 PM

Answers

  • A quick 1:  :D

    Import Code: FCG624-0

    ' Chronometer of Seconds (v1.0)
    ' by GoToLoop (2013/Dec) 
    '
    ' FCG624-0
    '
    'http://social.msdn.microsoft.com/Forums/en-US
    '/abc1f30d-b7f0-4347-a2f0-67575327ac54
    '/how-to-count-time-1-by-1-in-small-basic
    
    GW = 600
    GH = 400
    
    GraphicsWindow.CanResize = "False"
    GraphicsWindow.Width = GW
    GraphicsWindow.Height = GH
    
    CreateTimer()
    Timer.Interval = 1000 ' 1000ms = 1s
    Timer.Tick = Chronometer
    
    Sub CreateTimer
      GraphicsWindow.BrushColor= "Red"
      time= Shapes.AddText("0s")
      Shapes.Move(time  GW - 40, 10)
      seconds = 0
    EndSub
    
    
    Sub Chronometer
      seconds = seconds + 1
      Shapes.SetText(time,  seconds+"s")
    EndSub


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    • Marked as answer by Drocery Wednesday, December 11, 2013 6:32 PM
    Monday, December 9, 2013 8:33 PM
    Answerer

All replies

  • Perhaps asking this question in the appropriate MSDN forum would be a better choice....
    Monday, December 9, 2013 2:09 PM
  • Hi.

    Here is the forum for Small Basic:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=smallbasic

    Someone should be able to help you out there.

    Good luck!


    Best wishes, Davin Mickelson

    Monday, December 9, 2013 7:40 PM
  • Hi Drocery,

    You are now on the right forum, but am unclear exactly what your question is - do you have more explanation or some code you are working on.

    For many clock examples, search this forum using gray box at top 'Search forum questions' and type clock and then Return (or Enter).

    Monday, December 9, 2013 8:32 PM
    Moderator
  • A quick 1:  :D

    Import Code: FCG624-0

    ' Chronometer of Seconds (v1.0)
    ' by GoToLoop (2013/Dec) 
    '
    ' FCG624-0
    '
    'http://social.msdn.microsoft.com/Forums/en-US
    '/abc1f30d-b7f0-4347-a2f0-67575327ac54
    '/how-to-count-time-1-by-1-in-small-basic
    
    GW = 600
    GH = 400
    
    GraphicsWindow.CanResize = "False"
    GraphicsWindow.Width = GW
    GraphicsWindow.Height = GH
    
    CreateTimer()
    Timer.Interval = 1000 ' 1000ms = 1s
    Timer.Tick = Chronometer
    
    Sub CreateTimer
      GraphicsWindow.BrushColor= "Red"
      time= Shapes.AddText("0s")
      Shapes.Move(time  GW - 40, 10)
      seconds = 0
    EndSub
    
    
    Sub Chronometer
      seconds = seconds + 1
      Shapes.SetText(time,  seconds+"s")
    EndSub


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    • Marked as answer by Drocery Wednesday, December 11, 2013 6:32 PM
    Monday, December 9, 2013 8:33 PM
    Answerer
  • Thanks! That's what I want it! Thanks again. Thanks also for everyone ;)
    Wednesday, December 11, 2013 6:03 PM
  • Hi Drocery

    "although not a digital chronometer"

    You might also wish to consider using Clock calculations in your b/ground thread (created with the Timer.Tick event).

    The Clock uses system time and is system accurate.

    Here's a sample of Clock Calcs: PTH286

    Wednesday, December 11, 2013 8:29 PM
    Moderator