Computer Science Canada

how to bring the black blinking thing next to the numbers?

Author:  xmdxtreme [ Tue Jun 01, 2004 3:42 pm ]
Post subject:  how to bring the black blinking thing next to the numbers?

code:

var num : real
var st : string := ""
var key : string (1)

put "Enter amount:" ..
Text.Locate (1,14)
put "$0.00" ..
loop

    getch (key)
    if strintok (key) then
        st += key
    end if
    exit when key = chr (10)
    num := strint (st) / 100
    Text.Locate (1,14)
    put "$", num : 0 : 2
    locate (2, length (intstr (round (num))) + 5)
end loop

Author:  rhomer [ Tue Jun 01, 2004 4:04 pm ]
Post subject: 

Sorry i'm a little confudes...What is your question?

Author:  xmdxtreme [ Tue Jun 01, 2004 4:06 pm ]
Post subject: 

the black block that blinks i dunno whats the name its in the bottom middle when you run the program i want it to go next to the numbers not at the bottom,

Author:  rhomer [ Tue Jun 01, 2004 4:11 pm ]
Post subject: 

for me when i run it its next to the numbers not at the bottom.

Author:  xmdxtreme [ Tue Jun 01, 2004 4:14 pm ]
Post subject: 

erm type in a number then see...

Author:  rhomer [ Tue Jun 01, 2004 4:18 pm ]
Post subject: 

Is this right?

code:

var num : real
var st : string := ""
var key : string (1)

put "Enter amount:" ..
Text.Locate (1,14)
put "$0.00" ..
loop
    getch (key)
    if strintok (key) then
        st += key
    end if
    exit when key = chr (10)
    num := strint (st) / 100
    Text.Locate (1,14)
    put "$", num : 0 : 2..
    Text.Locate (1,19)
end loop

Author:  xmdxtreme [ Tue Jun 01, 2004 4:21 pm ]
Post subject: 

hmm thats good thanks but if you type in more number look what happens i hope theres a way to fix that Confused

Author:  xmdxtreme [ Tue Jun 01, 2004 4:24 pm ]
Post subject: 

wait is there a way just to remove the blinking box for that section if that makes it easier?

Author:  rhomer [ Tue Jun 01, 2004 4:24 pm ]
Post subject: 

Ok try this...

code:

var num : real
var st : string := ""
var key : string (1)
var col : int := 19
var count :int := 0

put "Enter amount:" ..

Text.Locate (1, 14)
put "$0.00" ..
loop
    getch (key)
    count += 1
    if strintok (key) then
        st += key
    end if
    exit when key = chr (10)
    num := strint (st) / 100
    Text.Locate (1, 14)
    put "$", num : 0 : 2 ..
    if count > 3 then
        col += 1
    end if
    Text.Locate (1, col)
end loop

Author:  Paul [ Tue Jun 01, 2004 4:27 pm ]
Post subject: 

to remove the blinking box (cursor) you do this at the top
code:

setscreen ("nocursor")

Author:  xmdxtreme [ Tue Jun 01, 2004 4:27 pm ]
Post subject: 

YES! THANKS ALOT I more question can you explain what happened cause i dont want to use code without understanding it Very Happy rhomer.

Author:  rhomer [ Tue Jun 01, 2004 4:28 pm ]
Post subject: 

setscreen("nocursor") will do it

Author:  xmdxtreme [ Tue Jun 01, 2004 4:29 pm ]
Post subject: 

no i thought it would be hard to to the cursor thing so i want it to be there i just wanted to make it easier for you but i saw that you did it with cursor can you just explain what you did?

Author:  Paul [ Tue Jun 01, 2004 4:30 pm ]
Post subject: 

lol you guys sure get excited... u don't even look at my post...

Author:  rhomer [ Tue Jun 01, 2004 4:33 pm ]
Post subject: 

ya sure...well what i noticed is that you had to locate the column in front of the 2nd decimal place. what i did was say that if you type in three numbers then on the fouth it will move over 1 column. ( i did this with count and column

code:

var col : int := 19
var count :int := 0



code:

getch (key)
count += 1



code:

   if count > 3 then
        col += 1
    end if
    Text.Locate (1, col)

Author:  xmdxtreme [ Tue Jun 01, 2004 4:36 pm ]
Post subject: 

sorry bout that paul lol. Laughing
rhomer thanks i got it. Wink


: