Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: return help

  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Montreal, QC
    Posts
    340
    Thanks
    3
    Thanked 2 Times in 2 Posts

    return help

    Hello,

    I need to do the equivalent of calling the return construct, (http://www.php.net/manual/en/function.return.php), but from within a function that is on an included script. I want it to end the execution of the included page but not the main page.

    Thanks,

    John
    Search for Laughter or Just Search?
    GiggleSearch.org
    Blog: www.johnbeales.com
    All About Ballet: www.the-ballet.com

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    British Columbia
    Posts
    235
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, then do it

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    The included page becomes part of the page it is included in as if it were part of that page. If you want a function to stop and return a value then put the return command in and return a value. I don't see where a problem is. Of ocurse you didn't really give us anything to go off of.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    Regular Coder
    Join Date
    Apr 2003
    Location
    Montreal, QC
    Posts
    340
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Something to go off of....

    Here's why I'm having problems doing it......

    I want to stop the xml_parse function halfway through it. IE, once I've parsed 4 news stories, (it's an XML news feed), each of which is contained in an <article> element I want to stop. I tried placing a continue; in the endElement function, but it still writes the rest of the elements' content, just no formatting. If I do a continue(2); I get an error message.

    I have figured out how to simply stop printing anything after the first 4 <article> elements however the script is still parsing, which is a waste of resources that I'd like to stop.

    John
    Search for Laughter or Just Search?
    GiggleSearch.org
    Blog: www.johnbeales.com
    All About Ballet: www.the-ballet.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •