微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何将编辑框 GUI 中的每一行存储到数组中? [自动热键图形界面]

如何解决如何将编辑框 GUI 中的每一行存储到数组中? [自动热键图形界面]

我需要将文本(EditBox GUI 元素)中的每一行存储到一个数组中。用户将在每一行中键入句子,每一行都需要存储在数组中。这是我的意思的一个例子:

Example Picture

Gui Add,Edit,xs R20 w550 vArrayTextArea,This needs to be the first item in array`n This needs to 
be the second item in array `nThis needs to be the thrid item in array..

; Button
Gui Add,Button,w350 gCreateScript xs,BUTTON

Gui Show
Return

CreateScript:
Gui Submit,NoHide
global ArrayEdit:=ArrayTextArea

Return

解决方法

例如 Gui,Add,Edit,R20 w550 vArrayTextArea,% "Line1`nLine2`nLine3" Gui,Button,w350 gCreateScript,BUTTON Gui,Show Return CreateScript: Gui,Submit,NoHide LineArray := StrSplit(ArrayTextArea,"`n","`r") for each,line in LineArray MsgBox,% line Return (docs) 很容易做到这一点。
示例脚本:

{{1}}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。