Sign in to follow this  
Followers 0
m0nk3yI3unz

_Should and _Alert

3 posts in this topic

#1 ·  Posted (edited)

Just to say, this upload is taking forever... ooh.. thats why.. theres over 800 ppl on here.

ANYWAYS...

I had to recreate these ()_()

Anyways...

_Should($Variable, $Check) - simple simple simple conditional check to see if $Variable (it must be a variable) equates to $Check, and if not, raises the error level to 1 and returns -1.

This one is just a bunch of code:

_Alert($Message, $Flag, $Reset) - I mainly made this for debugging purposes.

$reset - default 0, if 1, sets the error level back to 0.

Alerts are as follows:

Flag = -1 or 0, Plain message box with <!> ; titled "Error", message: "There was an error." and if $message was NOT "" or -1, then I appended "......rror. Program returned: "& $message

Flag = 1 - same as above, but with a Yes or No dialog and an appended "Continue?". returns 1 if the person said No.

Flag = 2 - same as -1, only with stop sign.

Flag = 3 - same as 1, with stop sign

Flag = 4 - Same as 1, with <?>

Enjoi.

-I3unz

EDIT: dang slowness... I guess I have to put them in codes (I had tried to upload it.)

;Had to recreate these. Made by m0nk3y_I3unz. Not taking the time to comment them. The instructions are on the boards.


func _Should(ByRef $Var,$Target)
    if $Var = $Target Then
        return 0
        else
        seterror(1)
        return -1
    EndIf
EndFunc


Func _Alert($Message="",$Flag=0,$Reset=0)
    switch $Message
    case ""
            switch $Flag
            Case -1
                msgbox(48+262144,"Error","There was an error.")
                if $Reset then seterror(0)
                return 0
            case 0
                msgbox(48+262144,"Error","There was an error.")
                if $Reset then seterror(0)
                return 0
            case 1
                if msgbox(4+48+262144,"Error","There was an error."&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
            case 2
                msgbox(16+262144,"Error","There was an error.")
                if $Reset then seterror(0)
                return 0
            case 3
                if msgbox(4+16+262144,"Error","There was an error."&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
            case 4
                if msgbox(4+32+262144,"Error","There was an error."&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
                case Else
                    return -1
                EndSwitch
    case -1
                            switch $Flag
                                Case -1
                msgbox(48+262144,"Error","There was an error.")
                if $Reset then seterror(0)
                return 0
            case 0
                msgbox(48+262144,"Error","There was an error.")
                if $Reset then seterror(0)
                return 0
            case 1
                if msgbox(4+48+262144,"Error","There was an error."&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
            case 2
                msgbox(16+262144,"Error","There was an error.")
                if $Reset then seterror(0)
                return 0
            case 3
                if msgbox(4+16+262144,"Error","There was an error."&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
            case 4
                if msgbox(4+32+262144,"Error","There was an error."&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
                case Else
                    return -1
                EndSwitch
                case else
            switch $Flag
                Case -1
                msgbox(48+262144,"Error","There was an error.")
                if $Reset then seterror(0)
                return 0
            case 0
                msgbox(48+262144,"Error","There was an error. Program returned:"&@CR&$Message)
                if $Reset then seterror(0)
                return 0
            case 1
                if msgbox(4+48+262144,"Error","There was an error. Program returned:"&@CR&$Message&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
            case 2
                msgbox(16+262144,"Error","There was an error. Program returned:"&@CR&$Message)
                if $Reset then seterror(0)
                return 0
            case 3
                if msgbox(4+16+262144,"Error","There was an error. Program returned:"&@CR&$Message&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
            case 4
                if msgbox(4+32+262144,"Error","There was an error. Program returned:"&@CR&$Message&@CR&"Continue?") = 7 then return 1
                if $Reset then seterror(0)
                case Else
                    return -1
                EndSwitch
    EndSwitch
EndFunc

;test

[auto];test[/auto]

Edited by m0nk3yI3unz

Monkeh.

Share this post


Link to post
Share on other sites



xD Yup :) Please tell if anyone uses? Thx!


Monkeh.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0