小编IBP*_*BPX的帖子

用空格缩进heredocs

对于我所从事的个人开发和项目,我们使用四个空格而不是制表符.但是,我需要使用heredoc,我不能在不打破缩进流的情况下这样做.

我能想到的唯一可行的方法是:

usage() {
    cat << '    EOF' | sed -e 's/^    //';
    Hello, this is a cool program.
    This should get unindented.
    This code should stay indented:
        something() {
            echo It works, yo!;
        }
    That's all.
    EOF
}
Run Code Online (Sandbox Code Playgroud)

有一个更好的方法吗?

如果这属于Unix/Linux Stack Exchange,请告诉我.

bash spaces heredoc indentation

31
推荐指数
1
解决办法
1万
查看次数

等待()在Haxe?

我开始使用Haxe和OpenFl,并且拥有一些Javascript和Lua的经验.
它很顺利,直到我需要一个类似于wait()Lua等的功能,它会停止脚本,直到你设置的秒数结束.

我该怎么做呢?

编辑:澄清一下,我正在构建Flash.

haxe delay wait openfl

6
推荐指数
1
解决办法
3837
查看次数

在 Haxe 中运行 Flash (AS3) 代码

我开始在Haxe中结合OpenFl进行开发,并且我需要能够在 Haxe 程序中运行Flash/AS3代码,而该程序无论如何都会被编译为 Flash。

我知道我可以使用该命令lime build -as3 as3source/,然后编辑代码并手动插入我需要运行的AS3代码,但如果可以的话,我宁愿不这样做。

有什么办法可以做到这一点吗?

flash haxe actionscript-3

1
推荐指数
1
解决办法
627
查看次数

标签 统计

haxe ×2

actionscript-3 ×1

bash ×1

delay ×1

flash ×1

heredoc ×1

indentation ×1

openfl ×1

spaces ×1

wait ×1