Page 1 of 1

Continue Publication after an ERROR (Lasterror)

PostPosted: Thu Feb 07, 2002 3:52 pm
by Jim Brammer
Problem:
In this scenerio, the developer wants to CALL an external function file. If the function file does not exist the program's execution stops. The developer wants the program to continue.

<hr>

Solution:
The solution would be to first use the FileExists command to determine if the function file is found before trying to CALL it. If the Function file is not found then you have the opportunity to perform other actions...


    m0ng00s3
    Continue Publication after an ERROR (Lasterror)

    When I try to call a non exsisting function, I recieve an error. This is not a problem. The problem is that when the LAST ERROR variable is set to : *Function with this name does not exsist* the publication stops.

    IS there anyway to continue the publicaion even when an error occurs ?

    Thanks


    <hr>


    Jim Brammer

    Did you turn off Errors?

    Book Properties > Misc > [x] Display Error Messages


    <hr>


    m0ng00s3

    Yes, I turned off the errors and it sitll stopped.


    <hr>


    Jim Brammer

    Can you do a FileExists to first determine if the external file is there before you try to CALL it? If it's not there, then of course you could ptush it by, or do something else...

    FileExists "External_Func" "[FEX]"
    If "[FEX]" "=" "True"
    CALL "External_Func"
    Else
    ... do something else
    EndIf


    <hr>

    m0ng00s3
    I will give that a go. Cheers !  




call
Function
FileExists
error
lasterror