Except

The Except function is used to manually generate a user defined error and pass it to the TRY/CATCH customized error handler.

Category: Error Handling


Syntax:
    null = Except( integer ErrorNumber )


Description:

The Except function will create a user-defined exception that is passed to the internal error handling system. A custom error handler can be created utilizing the TRY/CATCH functions.

The ErrorNumber parameter can be any number from 0 to 65,535 although users should not use values less than 1000 as these are reserved for the system. In this way customized error numbers can be assigned and passed to user-defined error handlers.


Platforms:
    Windows, DOS, Internet Active Pages


Example:
  FUNCTION main( )
    local err
    
    TRY

        today = date( "MMDDYY" )
        
        month = 0 + left( today, 2 )
        day = 0 + substr( today, 3, 2 )
        year = 0 + right( today, 2 )
		
        if ( month == 12 )
            EXCEPT( 1001 )
        end
        
        return( 1 )

    
    CATCH ( err )
    	local s
    	
        s =  "Error [" + err.errornum + "]"
        s += "at line #" + err.errorline
        s += " (" + ErrorAsText( err.errornum ) + ")"

        if ( err.errornum == 1001 )
            s += " Month is December exception"
        end

        msgDelay( 3000, s )

        return( 0 )
    END

  END

  
(c) 2000-2001 by West Coast Web Adventures, Inc., All Rights Reserved