腳本編寫者俱樂部希望添加到腳本索引範例中的優秀/有價值的腳本範例集合在我們上次的會議中,我們提出了收集好的例子的想法,這些例子可以作為範例添加到 JMP 的腳本索引中。
請在評論部分添加您的想法,並附上社區帖子的鏈接,或僅在評論中添加程式碼作為示例。請務必指定範例與哪個函數相關(您希望在哪裡看到這個範例!
我們會將所有建議提供給我們的支援團隊,並提供給開發人員,以便他們可以考慮添加其中至少一些。
措施:
- 在評論區添加你的建議
- 讚你喜歡的,希望可以加
我們至少在這篇文章中獲得了一個有價值的範例列表,它本身應該已經非常有幫助了。
謝謝!
回覆:腳本俱樂部希望將優秀/有價值的腳本範例集合添加到腳本索引範例中對於新列() & << 設定屬性() ,請新增連結至
動態編寫 JSL 程式碼
[或者,可以新增指向 Substitute 和 Expr 的連結。
問題:只有知道答案的使用者才能找到答案]
Names Default to Here(1);
// Open a sample data table
dt = Open("$SAMPLE_DATA/Cleansing.jmp");
// Values previously obtained from a lookup table and assigned to variables as:
myLSL = 6;
myUSL = 8;
myTarget = 7;
// Use the variables to set the spec limits column property
Eval(Eval Expr(
Column(dt, "pH") << Set Property(
"Spec Limits",
{LSL( Expr(myLSL) ), USL( Expr(myUSL) ), Target( Expr(myTarget) ), Show Limits( 1 )}
);
));回覆:腳本俱樂部希望將優秀/有價值的腳本範例集合添加到腳本索引範例中我總是忘記 Eval()、Eval Expr() 和 Expr() 如何協同工作,因此我已將此頁面加入書籤,並且我專門使用了連結頁面中的這段 JSL:
//Eval Expr
For( i = 1, i <= N Items(cols), i++,
Eval( Eval Expr(
dt << New Column(
"2 * " || Char( cols[i] ),
Numeric,
"Continuous",
Formula( As Column( Expr( Char( cols[i] ) ) ) * 2)
)
) )
);回覆:腳本俱樂部希望將優秀/有價值的腳本範例集合添加到腳本索引範例中For Get Environment Variable():
uname = Get Environment Variable( "USERNAME" );
來自: https
/community.jmp.com/t5/Discussions/computer-name/mp/753036/highlight/true#M93482
回覆:腳本俱樂部希望將優秀/有價值的腳本範例集合添加到腳本索引範例中在為了循環的描述中,新增資料表索引的鏈接,例如:
https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013
回覆:腳本俱樂部希望將優秀/有價值的腳本範例集合添加到腳本索引範例中
我對 Eval()、Substitute()、Expr() 也有同樣的技巧,特別是一系列涉及列的範例。
dt = Open("$SAMPLE_DATA/Tablet Production.jmp");
ColList = dt << Get Column Names( Continuous );
// New column
For( i = 1, i <= N Items( colList ), i++,
Eval(Substitute(
Expr(
newCol = dt << New Column(
col_Name,
Numeric,
"Continuous",
Format( "Percent", 12, 2 ),
Formula(As Column(col1) / Col_Mean )); ),
Expr(col_Name), "Ratio " || Char(colList[i]) || " vs. Col Mean",
Expr(col1),Column(dt,ColList[i]),
Expr(Col_Mean), Col mean(Column(dt,ColList[i]))
)));