This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
augustas656's profile picture

What features would be nice if added to the read() function?

Started by augustas656, 30 April 2014 - 06:25 PM
augustas656 #1
Posted 30 April 2014 - 08:25 PM
  • Perhaps a character limit, you can leave it to nil if you don't want it, or set it to a specific value to limit characters.
  • Perhaps allow disabling or leaving the blink feature, so perhaps you're making a very secret input.
I'm trying to make my own util api that just gives you a bunch of nice features that avoid your need to create functions commonly in a lot of events, let's say your making nice graphical displays, perhaps you'll need to center your text and you might just write out the center function in all those programs. I'm making a simple util (API) that avoids these issues. Although I'd like some interesting features as well. So please list and thank you very much.

Regards
Augustas
oeed #2
Posted 01 May 2014 - 07:53 AM
While many of these would be useful it wouldn't be too hard to copy the function and edit it to your needs.
Agoldfish #3
Posted 01 May 2014 - 01:55 PM
The blinking feature already exists…
Blue #4
Posted 01 May 2014 - 02:51 PM
search for term.setCursorBlink on the wiki :)/>
MKlegoman357 #5
Posted 01 May 2014 - 03:07 PM
The blinking feature already exists…
search for term.setCursorBlink on the wiki :)/>/>/>

He's talking about disabling it.

EDIT: Character limit, multiline, width/height limit and compatibility with programs which use default read function. That's what would be useful in my opinion.
Edited on 01 May 2014 - 01:13 PM
Agoldfish #6
Posted 01 May 2014 - 03:11 PM
The blinking feature already exists…
search for term.setCursorBlink on the wiki :)/>/>

He's talking about disabling it.
You can turn it off by setting it to false I think.
MKlegoman357 #7
Posted 01 May 2014 - 04:40 PM
You can turn it off by setting it to false I think.

Yes you can, but He's talking about an option to disable it in his read function.
Engineer #8
Posted 01 May 2014 - 04:47 PM
You can turn it off by setting it to false I think.

Yes you can, but He's talking about an option to disable it in his read function.
Which essentialy does the same
Agoldfish #9
Posted 01 May 2014 - 05:01 PM
You can turn it off by setting it to false I think.

Yes you can, but He's talking about an option to disable it in his read function.
All adding it into the read function would do is save a few lines of code, but I suppose it would be useful if you nitpick your code and make it short.
Lyqyd #10
Posted 01 May 2014 - 05:54 PM
term.setCursorBlink is called in read(), I believe. If that's the case, you'd be saving a few lines of code and another coroutine by adding such a feature. Either way, I don't see a whole lot of point to disabling the blink, personally.
augustas656 #11
Posted 01 May 2014 - 07:31 PM
Seriously, I gave examples, I am aware that they are extremely likely to already exist, I was only trying to give examples to clarify myself to others who might not understand what I'd want. I do realise you can edit the read function, that is the very reason I'm asking yous. I want to know what you would like to be in a read() function that isn't already and would be nice. So like, what interesting features could be nice. I'm asking because I'm making my own API, and I'm going to create a new read function, but I'd like some features to go a long with it, otherwise there's no point.

Regards
Augustas