Kann ich den JSL-Code posten?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.Betreff: Kann ich den JSL-Code posten?@stan_koprowski ist richtig. Das Symbol für die Schaltfläche zum Einfügen von JSL-Code fehlt, aber die Funktionalität funktioniert weiterhin.
Klicken Sie auf die Lücke zwischen den Schaltflächen Code einfügen und Link einfügen, und Sie erhalten ein Dialogfeld, in dem Sie Ihren JSL-Code einfügen können. Es erscheint unformatiert, bis Sie es posten, aber dann wird, genau wie bei der Landung von Dorothy in Oz, alles in Farbe sein.
Hier ist ein Beispiel:
/*
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" ) ) )
);Betreff: Kann ich den JSL-Code posten?Ja, der JSL-Syntax-Highlighter scheint gerade im Urlaub zu sein.
Normalerweise wird es zwischen dem Symbol zum Einfügen von Code und dem Symbol zum Einfügen von Links angezeigt.
Betreff: Kann ich den JSL-Code posten?(über den Schnellantwort-Button)
aber die Beibehaltung der Farbformatierung wäre wirklich hilfreich. Oder anders ausgedrückt: Ein Diskussionsforum, das sich so stark auf die Skriptsprache konzentriert, muss codefreundlich seinBetreff: Kann ich den JSL-Code posten?(mittels Antwortbutton)
Ich bin also froh, dass wir nicht auf die übliche Methode des Ausschneidens und Einfügens über MS-Word zurückgreifen müssen, aber es wäre schön, wenn das noch funktionieren würde
Betreff: Kann ich den JSL-Code posten?Hier ist der Code, der auf die "übliche" Weise gepostet wurde (Kopieren/Einfügen in MS-Word und dann hierher). Verliert alle Formatierungen:
// Dies ist ein Kommentar
ein = 123 ;
für ( k = 1 , k <= 99 , k++,
m = k^ 2 ;
) ;
Dies ist Code, der mit der Schaltfläche "Code einfügen" gepostet wird. Verliert Syntaxkolorierung.
// This is a comment
a = 123;
for (k = 1, k <= 99, k++,
m = k^2;
);