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.

DarkBASIC Discussion / editing a string with user input, using entry$()

Author
Message
arganox
19
Years of Service
User Offline
Joined: 17th Sep 2005
Location:
Posted: 17th Sep 2005 13:44
is it possible to grab a string and place it in the entry() buffer so the user can edit it or is there another way, i want to avoid using 'input' if possible

thanks

Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 17th Sep 2005 14:54








I can`t find the "good greif" smiley

to quote Mr babbage...I am unable to comprehend what confusion of ideas led to this question, you do not have to place a string in the entry buffer to edit it, there are hundreds of text input routines in the codebase, maybe millions, (ok..so I exagerate a bit...but there are more than one), I get this feeling you feel that putting text into the entry buffer would somehow enable people to edit it, that a editor of some sort would just pop up out of somewhere, it won`t.

if you want the user to edit text then write a simple line editor, I have posted these before, you only need 8 or so lines of code.



the average IQ is 100...but the people that took the test where trying to look smart. most people don`t go over 50.
Area 51?, I`m more intrested in what they have in areas 1 to 50
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Sep 2005 15:01
entry$() is a function that makes a buffer of all key-inputs. However, this function is only available in the enchanted mode.
I believe there is no way of adding a character in the entry buffer. But since you want to input without using the input command, I'd use this code I wrote:



Immunity and Annihalation makes Immunihalation...
arganox
19
Years of Service
User Offline
Joined: 17th Sep 2005
Location:
Posted: 17th Sep 2005 15:44
Great, thank you
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 17th Sep 2005 16:39 Edited at: 17th Sep 2005 16:41
rather than add to the entry$() buffer...

use that buffer to add to a variable, and at the start of the loop, clear the entry buffer for use again

Part of a chat program I was working on:


NewLetter$ is the whatever was in the entry buffer when it got to that line in the loop - end of the loop, it's cleared, so if the user's not pressing anything, NewLetter$ will be blank...

hope that helps in some way...

...maybe one day I'll finish a project

Login to post a reply

Server time is: 2025-05-22 17:16:28
Your offset time is: 2025-05-22 17:16:28