본문 바로가기
IT-개발,DB

[IT/개발] 파워빌더 MessageBox() 함수

by SB리치퍼슨 2010. 2. 17.
반응형

MessageBox PowerScript Function

사용자가 정의한 title, text, icon, button을 MessageBox에 Display한다.

MessageBox (title, text , icon, button , default )

Parameter Description

--------- ------------------------------------------------------

title Message box의 title bar에 지정한 문자열이 나타난다.
text
사용자가 원하는 text를 Message box에 Display한다.
text
는 numeric 자료형, string, boolean 값이 가능하다
Icon icon의 값은 사용자가 원하면 Message box의 왼쪽에 display하려는 icon들을 가리키는 data type들을 열거한다.

* Information! (Default)
* Stopsign!
* Exclamation!
* Question!
* None!

button 사용자가 display하려는 CommandButton을 messagebox하단에 setting하고
그
command button을 가리키는 data type을 열거한다.
버튼들은 열거된 데이타 타입의 순서로 번호붙여진다..

(optional)

* OK! - (Default) OK button
* OKCancel! - OK and Cancel buttons
* YesNo! - Yes and No buttons
* YesNoCancel! - Yes, No, and Cancel buttons
* RetryCancel! - Retry and Cancel buttons
* AboutRetryIgnorel - About, Retry, and Ignore buttons

default button의 번호는 default button으로 사용할 수 있다.
(optional) default는 1이고, 만약 사용자가 지정한 번호가 display된 button 번호 이상이면 , MessageBox는 default로 이용한다.




반환값

Integer 성공했다면 지정한 번호 (1, 2, 3)을 return 하고,

실패인경우 -1를 return한다.

title 이나 text 의 값이 null 이면, MessageBox 는 보여지지않는다.

사용자가 지정하지 않으면 파워빌더는 사용자가 버튼을 클릭하거나 엔터를 누를 때 스크립트 실행을 계속한다. 이것은 MessageBox가 버튼을 하나 가지고 있을 때 적합하다. 버튼이 많으면 스크립트안에 리턴값을 체크하고, 적합한 조치를 취하는 스크립트에 코드를 포함시켜야한다.

현재의 application 을 계속하기 전에 사용자는 MessageBox에 응답해야한다. 그러나, 사용자는 MessageBox에 응답하지 않고 다른 aplication으로 바꿀수 있다.

MessageBox에 "Greeting","Hello User" default icon, 과 default button을 보여준다.
MessageBox("Greeting", "Hello User")

다음 문장은 함수의 결과와 exclamation icon과 OK와 Cancel 버튼을 포함한 Result라는 제목의 MessageBox를 display한다.

integer Net
long Distance = 3.457

Net =
MessageBox("Result", Abs(Distance), & Exclamation!, OKCancel!, 2)

IF Net = 1 THEN
  ... // process OK
ELSE
  ... // Process CANCEL.
END IF



출처 : http://cafe.daum.net/pbcraft/3NoU/40?docid=7Zna|3NoU|40|20011102000753&q=%C6%C4%BF%F6%BA%F4%B4%F5%20MessageBox%20%B8%AE%C5%CF&srchid=CCB7Zna|3NoU|40|20011102000753

반응형

댓글