結合番号と連結番号の編集ボックスとスライダーボックス私はユーザーが選択するためのチャートを作成するために選択するためのテストのリストを含むウィンドウを表示するJSLスクリプトを作成しています。 各チャートには、ユーザーが設定した間隔が必要です。 この例では、チャートを作成するテストを1〜5回行うことができるため、番号編集ボックスに名前が付いていない場合に、番号編集ボックスを参照して関連するテストの正しい値を取得する方法私がつまずくところはMakeCharts = expr()の問題です。 このようなシナリオで、各番号編集ボックスに一意の名前を付ける方法はありますか?
//Create a list of all tests represented in this Data Table to be displayed as vertical check boxes
cbAllTests = Check Box( {"Test1", "Test2", "Test3", "Test4", "Test5"} );
//User Interface for selecting desired test results and charts
New Window( "Enter Capability", << Modal,
//Window Header
H Center Box(
H List Box(
tbAddCap = Text Box( "Select Tests to Average" ),
tbAddCap << Set Font( "Arial", 14, "Bold" )
)
),
//Test List Header
Spacer Box( Size( 10, 20 ) ),
H List Box(
Spacer Box( Size( 35, 20 ) ),
tbCap = Text Box( "Test"),
tbCap << Set Font( "Arial", 12, "Bold" )
),
//List of tests from this STR or list of STRs to select from
H List Box(
Spacer Box( Size( 10, 10 ) ),
cbTest = cbAllTests( i )
),
Spacer Box( Size( 10, 20 ) ),
//Display new window listing tests selected for Capability Data Entry
H Center Box( Button Box( "OK", GetChkBoxes ) )
);
//Window to Display Number Edit Boxes to enter values for only the tests being requested
CapWindow = New Window( "Enter Capability",
//Window Header
H Center Box(
H List Box(
tbEntVal = Text Box( "Enter Capability Values*" ),
tbEntVAl << Set Font( "Arial", 14, "Bold" )
)
),
//List of tests requested for Capability Value entry
H List Box(
vlbTests = V List Box()
),
H Center Box( Button Box( "OK", MakeCharts ) ) //WJL - Add procedure to collect values and add selected charts
);
if( N Items( CapTests ) >=1,
For( i = 1, i <= N Items( CapTests), i++,
Eval(
Expr(
vlbTests << Append(
H List Box(
Lineup Box( N Col(4),
tbTest = Text Box( CapTests[i] ),
tbTest << Set Width( 150 ),
tbPlMin = Text Box( "+/-" ),
tbPlMin << Set Font( "Arial", 10 ),
nebCap = Number Edit Box(0),
nebCap << Set Font( "Arial", 10 ),
tbUnits = Text Box( " % " ),
tbUnits << Set Font( "Arial", 10 )
)
)
)
)
)
)
);
GetChkBoxes = Expr(
CapTests = cbTest << Get Selected();
print( CapTests );
);
MakeCharts = Expr(
//This is where I need to collect the values in each Number Edit Box
//How do I reference when they are not uniquely named in the script?
);再結合結合番号編集ボックスとスライダーボックスこれを解決する1つの方法があります。 番号編集ボックスへのポインタがリストに配置され、リストの要素が特定の番号編集ボックスを指すために使用されます。
//Create a list of all tests represented in this Data Table to be displayed as vertical check boxes
cbAllTests = Check Box( {"Test1", "Test2", "Test3", "Test4", "Test5"} );
// This code needs to be processed before it is called
GetChkBoxes = Expr(
CapTests = cbTest << Get Selected();
print( CapTests );
);
//User Interface for selecting desired test results and charts
New Window( "Enter Capability", << Modal,
//Window Header
H Center Box(
H List Box(
tbAddCap = Text Box( "Select Tests to Average" ),
tbAddCap << Set Font( "Arial", 14, "Bold" )
)
),
//Test List Header
Spacer Box( Size( 10, 20 ) ),
H List Box(
Spacer Box( Size( 35, 20 ) ),
tbCap = Text Box( "Test"),
tbCap << Set Font( "Arial", 12, "Bold" )
),
//List of tests from this STR or list of STRs to select from
H List Box(
Spacer Box( Size( 10, 10 ) ),
cbTest = cbAllTests( i )
),
Spacer Box( Size( 10, 20 ) ),
//Display new window listing tests selected for Capability Data Entry
H Center Box( Button Box( "OK", GetChkBoxes ) )
);
//Window to Display Number Edit Boxes to enter values for only the tests being requested
CapWindow = New Window( "Enter Capability",
//Window Header
H Center Box(
H List Box(
tbEntVal = Text Box( "Enter Capability Values*" ),
tbEntVAl << Set Font( "Arial", 14, "Bold" )
)
),
//List of tests requested for Capability Value entry
H List Box(
vlbTests = V List Box()
),
H Center Box( Button Box( "OK", MakeCharts ) ) //WJL - Add procedure to collect values and add selected charts
);
// create a list to hold the pointers to the different Number Edit Boxes
nebCapList = {};
if( N Items( CapTests ) >=1,
For( i = 1, i <= N Items( CapTests), i++,
//Eval(
//Expr(
vlbTests << Append(
H List Box(
Lineup Box( N Col(4),
tbTest = Text Box( CapTests[i] ),
tbTest << Set Width( 150 ),
tbPlMin = Text Box( "+/-" ),
tbPlMin << Set Font( "Arial", 10 ),
nebCap = Number Edit Box(0),
nebCap << Set Font( "Arial", 10 ),
tbUnits = Text Box( " % " ),
tbUnits << Set Font( "Arial", 10 )
)
)
);
// add the pointer to the Number Edit Box, to the list
insert into(nebCapList,nebCap);
)
//)
//)
);
nebCapList[1] << set(55);
MakeCharts = Expr(
//This is where I need to collect the values in each Number Edit Box
//How do I reference when they are not uniquely named in the script?
);再結合結合番号編集ボックスとスライダーボックス @txnelson - 返事が遅れてすみませんが、私はようやくあなたの提案を実行に移すことができました...ありがとうございました!!!!それがチケットでした。 パーフェクトだ!