Author Topic: Confirm box  (Read 3669 times)

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Confirm box
« on: December 11, 2008, 11:40:39 PM »
I think there use to be some confirm dialog boxes for Icechat, but I'm not sure. Anyone remember if there was? Snerf, is there? If not, can there be? something like...

if Confirm("Would you like to...") then ...

Anyways.. Yeah. A simple yes / no dialog box would be great. returning no by default if its closed through the x or something.
This message brought to you by the Wonderful Wizard of Oz.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Confirm box
« Reply #1 on: December 12, 2008, 06:09:43 AM »
Don't know if this is what you're looking for but anyway:
Code: [Select]
Somevalue = MsgBox("confirm?",4)
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: Confirm box
« Reply #2 on: December 12, 2008, 09:19:36 AM »
I'd prefer a custom dialog since that one is blocking, but, it works. Thanks.
This message brought to you by the Wonderful Wizard of Oz.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Confirm box
« Reply #3 on: December 12, 2008, 11:09:39 AM »
MesBox is not blocking, thats a custom one added into IceChat Script Engine.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Confirm box
« Reply #4 on: December 13, 2008, 12:42:18 AM »
For those wondering why it won't work properly if you just change MsgBox to MesBox: The syntax for MesBox is slightly different from the one for MsgBox.

Code: [Select]
MsgBox prompt,buttons,title

MesBox propmt,title,buttons

if you leave the title empty when using MesBox, the dialog will have the title 'IceChat'

Also, here is a list of buttons you can use:
0 = vbOKOnly - OK button only
1 = vbOKCancel - OK and Cancel buttons
2 = vbAbortRetryIgnore - Abort, Retry, and Ignore buttons
3 = vbYesNoCancel - Yes, No, and Cancel buttons
4 = vbYesNo - Yes and No buttons
5 = vbRetryCancel - Retry and Cancel buttons
16 = vbCritical - Critical Message icon
32 = vbQuestion - Warning Query icon
48 = vbExclamation - Warning Message icon
64 = vbInformation - Information Message icon

And here is what the buttons return when clicked:
1 = vbOK - OK was clicked
2 = vbCancel - Cancel was clicked
3 = vbAbort - Abort was clicked
4 = vbRetry - Retry was clicked
5 = vbIgnore - Ignore was clicked
6 = vbYes - Yes was clicked
7 = vbNo - No was clicked
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: Confirm box
« Reply #5 on: December 13, 2008, 09:45:01 AM »
Thanks Morio ^_^
This message brought to you by the Wonderful Wizard of Oz.