버튼 상자 스크립트에 평가된 표현식을 적용하는 방법안녕,
스크롤 창이나 닫기와 같은 개별 개요 상자에 대한 스크립트 포인트를 지정하는 버튼 상자를 자동으로 추가하려고 합니다. For 루프를 통해 표현식을 구성하여 목록에 스크립트 항목의 이름을 성공적으로 삽입할 수 있었지만, 각 버튼 상자에 고유한 스크립트를 지정하려고 하면 대신 'buttonclickexpr' 표현식의 이름을 스크립트로 사용합니다.
버튼 상자를 클릭하면 실행되는 작성된 명령으로 표현식의 스크립트를 올바르게 평가하고 배치하려면 어떻게 해야 합니까?
//an example of how the window could appear
report_win=new window("test", content_VLB=V List Box(), Outline Box("Example: Distribution"), Outline Box("Example: Multivariate"));
//example of the variable that would store the name of scripts that created the OBs
script_new={"Distribution", "Multivariate", "Profiler"};
//the for loop to correctly setup the expression with the correct section name and add a button
For( i = 1, i <= N Items( script_new ), i++,
buttonclickexpr = Expr(
report_win << Scroll Window(
report_win[Outline Box( sectionName)]
)
);
Substitute Into( buttonclickexpr, Expr(sectionName), Char("Example: " ||script_new[i]) );
write(buttonclickexpr);
// Add a button to the list
content_VLB<
<APPEND></APPEND>
<BR />
<LINGO-LABS id="lingo-labs-914974" slang="en-US" mode="CREATE">
<LINGO-LABEL>자동화 및 스크립팅</LINGO-LABEL>
</LINGO-LABS>
Re: 버튼 상자 스크립트에 평가된 표현식을 적용하는 방법Eval(Eval Expr())을 사용할 수 있습니다.
//an example of how the window could appear
report_win = New Window( "test",
content_VLB = V List Box(),
Scroll box (Size(20,1500)),
Outline Box( "Example: Distribution" ),
Scroll box (Size(20,1500)),
Outline Box( "Example: Multivariate" )
);
//example of the variable that would store the name of scripts that created the OBs
script_new = {"Distribution", "Multivariate", "Profiler"};
//the for loop to correctly setup the expression with the correct section name and add a button
For( i = 1, i <= N Items( script_new ), i++,
buttonclickexpr = Expr(
report_win << Scroll Window( report_win[sectionName ] );
Caption(sectionName)
);
Substitute Into( buttonclickexpr, Expr( sectionName ), Char( "Example: " || script_new[i] ) );
Write( buttonclickexpr );
// Add a button to the list
Eval (Eval Expr(content_VLB << append( Button Box( "Go to " || script_new[i], Expr(Name Expr(buttonclickexpr)))) ));
);
OutlineBox("태그") 에서 태그는 OutlineBox의 HelperKey입니다. 제목을 통해 OutlineBox에 접근하려면 [ 개요 상자() 없이] 제목을 직접 사용할 수 있습니다.
자세한 내용은 Re: JMP의 표현식 처리: Tipps 및 Trapdoors 에서 확인할 수 있습니다.
| 사용 |
|
| 이름 Expr() |
... to retrieve the expression that is stored in the name buttonclickexpr |
| 표현식() |
... 코드를 표시하여 평가식() 이 찾을 수 있도록 합니다. |
| 평가식() |
... 표현식()을 찾아 평가합니다. |
| 평가() |
... 이전 단계를 거쳐 전체 표현식을 평가합니다. |
Re: 버튼 상자 스크립트에 평가된 표현식을 적용하는 방법대체 접근 방식: 대리자()
[이미 buttonclickexpr을 조정하는 데 사용됨 *)]
두 단계가 하나로 합쳐짐:
For each ({title}, script_new ,
myExpr = Expr(
content_VLB << append( Button Box( "Go to " || title,current report() << Scroll Window( current report()[_sectionName_ ] )));
);
Eval(Substitute (Name Expr(myExpr), Expr( _sectionName_ ), "Example: " || title ));
);
| 사용 |
|
| 대리자() |
... 문자열 대체와 유사하지만 인수가 평가된다는 점을 명심하세요! 이것이 ...를 사용해야 하는 이유입니다. |
| 이름 Expr() |
... 마이익스프레스 이라는 이름에 저장된 표현식을 검색하려면 - 평가도 없이!!! |
| 표현식() |
... to protect _sectionName_ from getting evaluated |
| 평가() |
... 이전 단계를 거쳐 전체 표현식을 평가합니다. |
*) Substitute 외. Substitute Into()는 첫 번째 인수를 평가하지 않습니다.