How to make ? decimal HSCROLL BAR (0,0.1,0.2,,,,,,,,,,,,,,,,,,,,9.9,10.0) in the below program

Modified Archery2

CALL TC_SetIncrements(speedset,0.1,10) why doesn't work below program.
(must other call routines be changed which one ?)

print "current speed =";speed

I want program gives speed 0,0.1,0.2,......1.0,1.1,1.2,..................10

whem move HSCROLL BAR

------------------------------------------------------------------------------------------------------
how to change code below to do this
------------------------------------------------------------------------------------------------------

! Modified Archery2

! A simple archery game.
! Shooting over a hill at a hidden target.

LIBRARY "TrueCtrl.trc"

OPTION ANGLE degrees
RANDOMIZE

CALL TC_Init ! Initialize for True Controls routines

CALL TC_Win_SetBrush (0, 11, -1, "") ! Set output window color
CALL TC_Show (0) ! Show the default output window
CALL TC_Win_Active (0) ! Move it to the front

LET left = -50 ! World coordinates, in feet
LET right = 200
LET bottom = -50
LET top = 100
LET g = 32.16 ! Acceleration due to gravity

SET WINDOW left, right, bottom, top

CALL TC_Show_Default (0) ! Don't automatically show things

! Create speed-setting scroll bar and related controls.

CALL TC_SText_Create (st1, "Force", -42, -20, -38, -99999)
CALL TC_SText_Create (speed0, "0", -12, -5, -38, -99999)
CALL TC_SText_Create (speed200, "200", 170, 185, -38, -99999)
CALL TC_SText_Create (speeddial, "0", -42, -20, -99999, -40)
CALL TC_SBar_Create (speedset, "HSCROLL", -12, 185, -99999, -40)

! Set the scroll bar parameters and increments.

CALL TC_Sbar_SetRange (speedset, 0, 210, 10)
CALL TC_Sbar_SetIncrements (speedset, .1, 10)
CALL TC_Sbar_SetPosition (speedset, 0)

LET currentspeed = 0
CALL MakeScene

DO ! Main event loop
! LET x1, x2 = 0
CALL TC_Event (0, event$, window, x1, x2) ! Get next event

SELECT CASE event$
CASE "LEFT", "RIGHT", "PAGELEFT", "PAGERIGHT", "HSCROLL", "END HSCROLL"
CALL TC_SBar_GetPosition (speedset, speed)
IF speed <> currentspeed then
LET currentspeed = speed
CALL TC_SetText (speeddial, str$(currentspeed))
print "current speed =";speed
END IF

CASE ELSE
END SELECT

LOOP

PAUSE 3

CALL TC_Cleanup

STOP

! Now, the subroutines

SUB MakeScene

CLEAR
CALL ShowControls
END SUB

SUB ShowControls

CALL TC_Show (st1)
CALL TC_Show (speed0)
CALL TC_Show (speed200)
CALL TC_Show (speeddial)
CALL TC_Show (speedset)

END SUB

END

Comments

re:Hscroll

I couldn't get the .1 increments to work--however this is a workaround.

You do need to change the first line from your
CALL TC_Sbar_SetRange (speedset, 0, 210, 10)
to
CALL TC_Sbar_SetRange (speedset, 0, 20, 10)

to get the 0-10 range. Assume that 210 was just a mistype, but as mentioned I can't get the .1 increments to work. See below however for changes that seem to be the workaround.

***added later: It is possible (not sure) that SetIncrements only does integer values. I'm too lazy to look at the source code---someone else might do that. If such is the case, then the workaround below should work (you may need to adjust a couple more variables to make the whole program work).*****

rwt

CALL TC_Sbar_SetRange (speedset, 0, 200, 100)
CALL TC_Sbar_SetIncrements (speedset, .1, 100)
CALL TC_Sbar_SetPosition (speedset, 0)

LET currentspeed = 0
CALL MakeScene

DO ! Main event loop
! LET x1, x2 = 0
CALL TC_Event (0, event$, window, x1, x2) ! Get next event

SELECT CASE event$
CASE "LEFT", "RIGHT", "PAGELEFT", "PAGERIGHT", "HSCROLL", "END HSCROLL"
CALL TC_SBar_GetPosition (speedset, speed)
IF speed <> currentspeed then
LET currentspeed = speed/10
CALL TC_SetText (speeddial, str$(currentspeed))
print "current speed =";currentspeed
END IF