Get DOE Factor Names = Function({table},{Default Local},
lstFactors = {};
dt = Open(table);
For (i=1,i<=NCols(dt),i++,
col = Column(dt,i);
colName = col << Get Name;
changes = col << Get Property("Factor Changes");
If (!IsEmpty(changes),
InsertInto(lstFactors,colName)
);
);
Close(dt,NoSave);
Return(lstFactors);
);
The "insert code" icon seems to do its job. There is also a link to a "jsl syntax highlighter" but I hot lost with that one.@stan_koprowski是对的。 插入 JSL 代码按钮的图标丢失,但该功能仍然有效。
单击插入代码和插入链接按钮之间的空隙,您将看到一个对话框,您可以在其中粘贴 JSL 代码。 在您发布之前,它会显示为未格式化,但是之后,就像多萝西登陆奥兹国一样,所有内容都将是彩色的。
这是一个例子:
/*
TIMING CHART CREATOR
jay holavarri 10-13-2016
Requires a table with the columns Component, Start, End.
*/
Names Default to Here(1);
dt=current datatable();
maxTime = ColMax(:End);
Summarize(dt, compList = By(:Component));
dt2 = New Table("Timing Chart");
New Column("Component_", Character);
colTime = New Column("Time (ms)");
New Column("Bit Status");
Current Data Table(dt);
catListAll = {};
timeIndexAll = [];
timeIndex0 = Index(0, maxTime, 10);
bitMatrix = [];
//Loop for ON time of each component
For(i=1, i<=N Rows(dt), i++,
timeIndex = Index(:Start[i],:End[i],10);
timeRows = N Cols(timeIndex);
catString = Repeat(:Component[i] || ",", timeRows);
catList = Words(catString, ",");
InsertInto(catListAll, catList);
timeIndexAll = Concat(timeIndexAll, timeIndex);
bitMatrix ||= J(1, timeRows, 1);
);
//Loop for OFF time of each component. Note that it puts a 0 for every available time,
//and the 1's appear in the chart by using the Max function in Graph Builder
For(i=1, i<= N Items(compList), i++,
timeRows0 = N Cols(timeIndex0);
catString0 = Repeat(compList[i] || ",", timeRows0);
catList0 = Words(catString0, ",");
InsertInto(catListAll, catList0);
timeIndexAll = Concat(timeIndexAll, timeIndex0);
bitMatrix ||= J(1, timeRows0, 0);
);
//Write to the datatable
dt2:Component_ << Set Values(catListAll);
colTime << Set Values(timeIndexAll);
dt2:bitStatus << Set Values(bitMatrix);
dt2 << Graph Builder(
Variables( X( :Name( "Time (ms)" ) ), Y( :Bit Status ), Group Y( :Component_ ) ),
Elements( Line( X, Y, Legend( 25 ), Summary Statistic( "Max" ) ) )
);(使用回复按钮)
所以我很高兴我们不必诉诸通过 MS-Word 进行剪切和粘贴的常用方法,但如果它仍然有效,那就太好了
这是以“常规”方式发布的代码(复制/粘贴到 MS-Word,然后到此处)。 丢失所有格式:
// 这是一条评论
一个= 123 ;
为了( k = 1个, k <= 99 , k++,
m = k^ 2个;
) ;
这是使用插入代码按钮发布的代码。 失去语法着色。
// This is a comment
a = 123;
for (k = 1, k <= 99, k++,
m = k^2;
);