Re: enhancing prompt() functions

new topic     » goto parent     » topic index » view thread      » older message » newer message
euphoric said...
mattlewis said...

I'm not sure why we'd need to do all of that. Using the example above, it might look like:

Enter username: [Steve Jones]  
Then, if you simply press enter, it's as though you entered Steve Jones. Otherwise, whatever the user enters is returned.

I don't see an easy way to get "Steve Jones" into the buffer, which I think is what would have to happen.

I'm going to try a puts(0,default) and see if that works. :)

Edit: It doesn't work. :/

Well, in my console (konsole), I can copy and paste, and edit whatever's there. And then I get the end result:

include std/console.e 
printf(1, "you entered: [%s]\n", { prompt_string("enter something:") }) 

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu