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" ) ) )
);はい、JSLシンタックスハイライトは現在休暇中です。
通常は、コードの挿入アイコンとリンクの挿入アイコンの間に表示されます。
(返信ボタンを使用)
だから私たちはMS-Wordによるカットアンドペーストの通常の方法に頼る必要はないことをうれしく思いますが、それでもうまくいくのであればいいでしょう。
これが「通常の」方法で投稿されたコードです(MS-Wordにコピーして貼り付けてから、ここに貼り付けます)。 すべてのフォーマットを失います。
//これはコメントです
a = 123 ;
にとって ( k = 1 、k <= 99年 、k ++、
m = k ^ 2 ;
) ;
これはコードの挿入ボタンで投稿されたコードです。構文の色付けを失います。
// This is a comment
a = 123;
for (k = 1, k <= 99, k++,
m = k^2;
);