Jump to content




Read() and limit length of the input field


  • You cannot reply to this topic
5 replies to this topic

#1 VaNnOrus

  • Members
  • 13 posts

Posted 26 November 2013 - 09:30 AM

Is there any way to limit the length of the input field or automatically transfer cursor to the next line when approaching the edge of the screen in the function "read()"?

#2 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 26 November 2013 - 09:33 AM

Not in standard read() function. You can however write your own version of read function that does exactly what you need.
If you take a look into bios.lua file you can find definition of standard read that you can edit if you don't want to write it from scratch.

#3 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 26 November 2013 - 11:49 AM

I believe there is an api that does this.

#4 VaNnOrus

  • Members
  • 13 posts

Posted 26 November 2013 - 08:56 PM

View Postwojbie, on 26 November 2013 - 09:33 AM, said:

Not in standard read() function. You can however write your own version of read function that does exactly what you need. If you take a look into bios.lua file you can find definition of standard read that you can edit if you don't want to write it from scratch.
Oh, thanx, I try rewrite this function :)
I will write here when I'll get the desired result :3

Edited by VaNnOrus, 26 November 2013 - 08:58 PM.


#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 26 November 2013 - 10:05 PM

View PostVaNnOrus, on 26 November 2013 - 08:56 PM, said:

Oh, thanx, I try rewrite this function :)
I will write here when I'll get the desired result :3
If you are feeling exceptionally lazy I do have a working implementation. Its a rewrite I performed of the default `read` but more efficient, and more capabilities, best of all without breaking default usages. You can find more information about it in my programs thread under code snippets.

#6 VaNnOrus

  • Members
  • 13 posts

Posted 30 November 2013 - 02:33 AM

View Posttheoriginalbit, on 26 November 2013 - 10:05 PM, said:

If you are feeling exceptionally lazy I do have a working implementation. Its a rewrite I performed of the default `read` but more efficient, and more capabilities, best of all without breaking default usages. You can find more information about it in my programs thread under code snippets.
It's interesting, I use some things in my function, thanx :)

-- UPD
that's what I did, but have not yet written walking the cursor line by line

Attached Image: 11.png

Edited by VaNnOrus, 30 November 2013 - 03:45 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users