你好社區。 我在使用 ChatGPT 的腳本時遇到問題。 我想構建一個腳本,可以在“選擇框”中選擇特定列並設置規格限制上限和下限也顯示為列屬性上的圖形參考線。 之後,它將打開“Fit Y by X”圖表,如下圖所示。 請幫忙...@tx尼爾森
// Open a data table or replace "Data Table Name" with the name of your data table
dt = Current Data Table();
// Get the column names from the data table
columnNames = dt << Get Column Names("String");
// Create a new choice list
cl = New Window("Column Selection",
H List Box(
Choice Box(
columnNames,
"Select a Column",
Value(columnNames[1]),
Set Selected
),
Button Box("OK",
<<CLOSE window=""></CLOSE>嗨,我的感覺是,這個腳本有很多錯誤。 下面,我剛剛提供了從上到下閱讀 ChatGPT 生成的腳本時的一些第一印象,忽略了許多其他看起來不正確的內容。
這似乎不是 JSL:
Choice Box();
我懷疑你想用類似的東西替換它:
Col List Box();
在您的“選擇列表”中,兩個按鈕框的腳本不起作用,甚至可能阻止創建窗口。 如果腳本的這一部分被修改如下所示,這將創建一個窗口,其中的按鈕按照我認為您希望它們工作的方式工作。
// Create a new choice list
cl = New Window("Column Selection",
H List Box(
Col List Box(
all,
width( 250 ), maxSelected( 1 )
),
Button Box("OK",
cl <<CLOSE window=""></CLOSE>等待用戶輸入一秒鐘? 我不確定這是否有意義並且是否有必要。
// Wait for user input
Wait(1); // what is the use of this?
“cl”是對創建的窗口的引用,但您(或 ChatGPT)將其用作表引用。
// Get the selected column name
selectedColumn = cl[1] << Get Selected; // cl is not a table reference
// Close the window
Close(cl, NoSave); // cl is not a table reference
不是一個非常有經驗的腳本編寫者,但有一次我要求 ChatGPT 編寫 JSL 代碼片段,但它不起作用,儘管這只是一項非常簡單的任務。 有一次,它甚至“忘記”了我們談話的主題是 JSL,它似乎與其他縮寫為 JSL 的東西混淆了。 對我開始編寫腳本有很大幫助的參考資料是跳轉到 JMP 腳本編寫。 您還需要查看 JMP 腳本指南和腳本索引。