q/kdb: 如何将我的代码分成几行。是否有新行 'escape' 字符或类似的东西?

q/kdb: How do I break my code into lines. Is there a new line 'escape' character or something similar?

我正在写一行长脚本。我想通过将代码分成多行来组织我的代码,而不必编写函数。我该怎么做?

您可以将代码分成多行,只要您缩进每个后续行即可。您应该使用分号来分隔缩进的表达式。

例如,拆分成多行的简单 select 语句可能如下所示;

t:([]a:1 2 3;b:`a`b`c);

res:select
    from t
    where a<>1,
    b in `a`c;


show res

可以在此处找到更多信息;

http://code.kx.com/q/tutorials/startingq/language/#29-scripts