gpt4 book ai didi

lua - lua 中的 io.read() 错误

转载 作者:行者123 更新时间:2023-12-01 05:21:04 25 4
gpt4 key购买 nike

当我使用 io.read()我从用户那里得到输入,但是当我这样做时,它不会计算退格,所以如果我输入:

blah blah blaht

当我的程序需要输入时,如果我删除 电话 :
blah blah blah

它仍然读起来好像 电话 有吗,求助

编辑:仅在调试时执行此操作,我使用 SciTE,谢谢

最佳答案

我一直试图弄清楚这一点很长一段时间,我遇到了这个:

You have two programs here: SciTE and cmd. SciTE sends each visible character like 'r' through to cmd as soon as it is typed. ScITE interprets the backspace key internally to change the buffer but does not send the key through to cmd. You can not edit a command line as you want. Simplest to type Enter and try again. (source)



不幸的是,似乎无法解决这个问题。

您最好的选择是:
  • 在 SciTE 之外执行 Lua 脚本就不会出现这个问题
  • 使用其他编辑器
  • 关于lua - lua 中的 io.read() 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16654063/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com