You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用LitDev扩展编写Small Basic代码报错:Token is incorrect

解决LitDev扩展Small Basic代码的"Token is incorrect"错误

你遇到的错误核心是LDControls.SetButtonStyle方法的参数类型不匹配:

  • 该方法最后一个参数flat要求传入布尔值(True或False),但你传入了带引号的字符串"False",Small Basic无法将字符串解析为方法所需的布尔类型令牌,因此抛出错误。

补充说明:LDControls.SetButtonStyle的参数顺序为「按钮对象、背景色、前景色、边框色、边框宽度、圆角半径、字体、字号、扁平化开关」,你传入的空字符串参数属于合法的默认值占位,但布尔类型参数必须严格使用无引号的原生布尔值。

修正后的代码:

GraphicsWindow.BackgroundColor = "blue"
button = Controls.AddButton("Hej", 100, 100)
LDControls.SetButtonStyle(button, "Blue", "", "", "", "", "", 0, False)

内容的提问来源于stack exchange,提问作者user22265143

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 10:34:49