Puis-je publier le code JSLGet 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.Re : Puis-je publier le code JSL@stan_koprowski est correct. L'icône du bouton d'insertion du code JSL est manquante, mais la fonctionnalité fonctionne toujours.
Cliquez sur l'espace entre les boutons d'insertion de code et d'insertion de lien et vous obtiendrez une boîte de dialogue dans laquelle vous pourrez coller votre code JSL. Il apparaîtra non formaté jusqu'à ce que vous le postiez mais ensuite, tout comme Dorothy atterrissant à Oz, tout sera en couleur.
Voici un exemple :
/*
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" ) ) )
);Re : Puis-je publier le code JSLOui, le surligneur de syntaxe JSL semble être en vacances pour le moment.
Normalement, il apparaît entre l'icône d'insertion de code et l'icône d'insertion de lien.
Re : Puis-je publier le code JSL(en utilisant le bouton de réponse rapide)
mais conserver la mise en forme des couleurs serait vraiment utile. Ou en d'autres termes, avoir un forum de discussion qui est si fortement axé sur le langage de script doit être compatible avec le codeRe : Puis-je publier le code JSL(à l'aide du bouton de réponse)
Je suis donc heureux que nous n'ayons pas à recourir à la méthode habituelle de copier-coller via MS-Word, mais ce serait bien si cela fonctionnait toujours
Re : Puis-je publier le code JSLVoici le code affiché de la manière "habituelle" (copier/coller dans MS-Word, puis ici). Perd tout formatage :
// Ceci est un commentaire
un = 123 ;
pour ( k = 1 , k <= 99 , k++,
m = k^ 2 ;
) ;
C'est le code affiché avec le bouton d'insertion de code. Perd la colorisation de la syntaxe.
// This is a comment
a = 123;
for (k = 1, k <= 99, k++,
m = k^2;
);