Page 1 of 1 1
Topic Options
#139011 - 2005-05-02 08:06 PM A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
Hello Everyone,

I am not sure where to start with this question so I am going to explain what I want to do. I want to create a pop up window once a user logs in with their account that will stop the login process and post a agreement from that they have to say yes too or it will not go any further. Is this possible ? If so I could not find the info and I am sorry I have been looking for an hour or so.

Thank You
Josh M

Top
#139012 - 2005-05-02 08:22 PM Re: A Newbie Form Question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Could start looking at something like this:

Code:

break on

$answer = messagebox("EULA", "Do you agree to the terms?", 4)

if $answer <> 6

?"logging you off..."

; logoff(1)

endif

exit 0



-Shawn

Top
#139013 - 2005-05-02 09:15 PM Re: A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
This is exactly what I was looking for. Thanks for the info. By the way do you know why the logoff does not work ??

Thanks Josh

Top
#139014 - 2005-05-02 09:38 PM Re: A Newbie Form Question
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Did you uncomment the line?

Code:

break on
$answer = messagebox("EULA", "Do you agree to the terms?", 4)
if $answer <> 6
?"logging you off..."
logoff(1)
endif
exit 0



Failing that, you can check the errorlevel...

Code:

break on
$answer = messagebox("EULA", "Do you agree to the terms?", 4)
if $answer <> 6
?"logging you off..."
logoff(1)
? @ERROR + " : " + @SERROR
endif
exit 0


Top
#139015 - 2005-05-02 09:43 PM Re: A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
Yes I did figure out to take out the comment line. By the way why is it

<> 6 ???

Why 6

Thanks
Newbie
Josh

Top
#139016 - 2005-05-02 09:45 PM Re: A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
One Last Dumb Newb Question ;o)

Is their a way to put a max, min or a scrollbar on this message box ?

Thanks
Josh

Top
#139017 - 2005-05-02 09:49 PM Re: A Newbie Form Question
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Josh, all of these commands are in the manual. You should try to find the answers there first.
Top
#139018 - 2005-05-02 09:54 PM Re: A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
Sorry Chris,

I found the information in the manual.

I will read before I post any dumb questions (

Josh

Top
#139019 - 2005-05-02 10:05 PM Re: A Newbie Form Question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Glad we could be of help. Did you get all the answers you were looking for ?

-Shawn

Top
#139020 - 2005-05-02 10:19 PM Re: A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
I did thanks Shawn...

However as I read the message box info in the manual shouldn't I be able to use a "=" to define yes or no. For example should this not work ?

Code:
--------------------------------------------------------------------------------

break on
$answer = messagebox("EULA", "Do you agree to the terms?", 4)

if $answer = 6
? "logging you on..."
endif
if $answers = 7
? "logging you off..."
LogOff(1)
EndIf
exit 0

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

Thanks again for the help, I have a degree in programming but it has been forever since I have done any type of programming, as you can tell )

Thank You
Josh

Top
#139021 - 2005-05-02 10:23 PM Re: A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
LOL

I had a TYPO

I found the problem and it is working, thanks.

Josh

Top
#139022 - 2005-05-02 10:40 PM Re: A Newbie Form Question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
The reason I specifically used <> (not equal) 6 is because that is the only answer your looking for ... if the user clicks NO or cancels the dialogbox some other way (which on XP doesn't seem possible), then log the bugger off ;0)

-Shawn

Top
#139023 - 2005-05-02 10:42 PM Re: A Newbie Form Question
jmontgom Offline
Fresh Scripter

Registered: 2005-04-29
Posts: 33
It works well,

Thanks Shawn.

I have been looking is their any way to do a scroll bar on a message box. I dont see it in the manual.

Josh M

Top
#139024 - 2005-05-02 10:49 PM Re: A Newbie Form Question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Unfortunately not possible with the standard Windows MessageBox dialog - no scrollbar support - just have to get by with one big honking MessageBox.

-Shawn

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 3139 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.23 seconds in which 0.192 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org