我更喜欢生成唯一的随机字母数字字符串,以附加到我的UID的末尾.
到目前为止,我在类库中找到的最接近的是Random类,它生成的数字是下一个最好的东西.
到目前为止我所拥有的是:
getNextRandomNumber
^(((rand nextValue) /
(Time now milliSeconds asInteger / Time now minutes asInteger
+ (Time now hour24 asInteger)) asInteger)).
Run Code Online (Sandbox Code Playgroud)
rand 是一个类变量,初始化为:
initialize
rand := Random new.
Run Code Online (Sandbox Code Playgroud)
这看起来写得很糟糕.但我不确定还能做些什么.
我是livecode的新手.我创建了一个后退按钮,并在on mouseup事件下面添加了代码.我把后退按钮放在里面Card 5.在Card 1,我有代码将去Card 5.
问题是,当我按下卡5中的后退按钮时,它总是会进入Card 4.这是正确的行为吗?我在想是不是应该去哪张Card 1是前一张卡.还有另一种方法吗?
谢谢您的帮助.
码:
go to the previous card
Run Code Online (Sandbox Code Playgroud)
牌:
Card 1 Card 2 Card 3 Card 4 Card 5
更新:
我设法解决了自己的问题.我创建了一个全局变量来存储以前的卡名并使用这行代码go to card "previous card name".但如果其他人有更好的解决方案,那就太好了.
似乎我需要将 couchDB JSON 文档加载到客户端,然后将其发布到另一个 couchdb 数据库,以便将其从一个数据库复制到另一个数据库?或者是否有服务器端方法可以这样做?
参考 http://docs.couchdb.org/en/latest/api/documents.html#copy-db-doc 复制命令是非标准的 http,只在一个 db 内。
我已经定义了一个局部变量
local tSuppressLines
Run Code Online (Sandbox Code Playgroud)
我想确保检查局部变量,以便我有一个错字
if not tSuppessLines then
-- do something
end if
Run Code Online (Sandbox Code Playgroud)
我收到警告
我想通过代码创建一组字段.
create group
set the name of it to "myGroup"
create field
set the name of it to "myField"
set the top of field "myField" to 10
set the width of field "myField" to 100
set the left of field "myField" to 20
-- add myField to myGroup
-- ??
set the backgroundBehavior of group "myGroup" to true
Run Code Online (Sandbox Code Playgroud)
问题