Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
wayelrob
17
Years of Service
User Offline
Joined: 8th May 2007
Location:
Posted: 3rd Jun 2007 04:08
How does one get the cursor to show on and blinking with the INPUT command?
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 3rd Jun 2007 20:01
Use the hide and show mouse commands. To make it blink at an inputed speed you simply wait the inputed varible between switching.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Jun 2007 00:03
Jerok:

Good answer - to the wrong question mind you!

wayelrob

Not 100% sure in DBP, but I don't think you can...

TDK_Man

zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 4th Jun 2007 05:05 Edited at: 4th Jun 2007 05:08
couldn't you just paste an animated sprite at the cursor position? I'll have to test, because I'm not exactly sure the cursor position is updated during input, but you could still detect keypresses in the entry$ buffer and move the graphic over at each press.

Not sure I would use input to get the text though, as I believe there wouldn't be an easy way to continue program flow until enter is pressed. So as long as your willing to do away with input. If it's a must, I will have to think a bit more.

I'll test out the theory in a few minutes, I have to give a friend a ride home.

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Jun 2007 07:40 Edited at: 4th Jun 2007 07:40
Make a string, call it mycursor, use the | symbol.
Make a timer for the cursor.
Position the cursor string on the same line as the input with a buffer of how many letters are entered in times by the font size.
Use the timer to either switch on and off or to change it from two colours which would appear to be invisible on one state.
This would allow you to control the symbol, the speed, and its ability to be invisible on any background.

zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 4th Jun 2007 07:52 Edited at: 4th Jun 2007 07:53
Indi, it wouldn't work using the built-in INPUT command, right?

It allows you to have a prompt string, but it won't allow you to move it along with the cursor in any way - or would it?

I don't use input, except for quick test stubs. Writing your own function gives more flexibility. But I am curious...

Funny how I pictured the blinking cursor to be like the 8-bit Atari's (a white blinking box) or DOS's "_". When I read your post for some reason I thought "|" doesn't sound right, then I looked at the cursor on the screen...

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Jun 2007 08:28 Edited at: 4th Jun 2007 08:29
it works with the inbuilt input or your own if:

Quote: "Position the cursor string on the same line as the input with a buffer of how many letters are entered in times by the font size."


TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Jun 2007 18:49
I, like zenassem was under the impression that DBP was like DBC (and all other procedural BASIC languages) in that when using the Input command, the whole program grinds to a halt while waiting for the user to type something.

As such, you can't do anything - with timers or otherwise until the Enter key had been pressed.

And the cursor - or lack of it - is purely down to the in-build Input command and you can't do anything about it. Or so I thought...

TDK_Man

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 5th Jun 2007 00:08
Quote: ""Position the cursor string on the same line as the input with a buffer of how many letters are entered in times by the font size.""


Won't TEXT WIDTH work as well (or is that only DBPro)

BrokenGlass
17
Years of Service
User Offline
Joined: 4th Jun 2007
Location: In teh lab coding
Posted: 5th Jun 2007 03:31
Yeah, i was wondering the same thing.

<- Click me!
Current Project: Learning DBP
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 6th Jun 2007 17:04
Quote: "Good answer - to the wrong question mind you!"


Oops...Sorry about that
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 7th Jun 2007 04:51
tdk that im not sure of now.
sixty yup should work as well.
write a little sample if anyone wants to explore it more perhaps.

Login to post a reply

Server time is: 2024-11-25 17:50:46
Your offset time is: 2024-11-25 17:50:46