Oh, watch your = vs. == in your if statements.

On Tue, 30 Jul 2002, Jeffrey wrote:

> Wish it was that easy, here is the call to end the page right above as im
> trying to trouble shoot this problem.
>
> // End document
> PDF_end_page($p);
>
> // Test document open close function
> next_page(open);
> next_page(close);
>
>
> I can remove those next_page function calls and just put in the
> PDF_begin_page and end page calls and it works right away, but it wont work
> inside the function :(.
>
> Jeff
>
>
>
> Rasmus Lerdorf <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Sounds like you didn't call pdf_end_page() before calling your next_page()
> > function.
> >
> > -Rasmus
> >
> > On Tue, 30 Jul 2002, Jeffrey wrote:
> >
> > > Here we go again; I posted the message "pdflib, NEED HELP with
> > > function problem (newby)" and thank you to all that helped. Even
> > > after that help, seems I cant understand scope to well.
> > >
> > > Im trying to make a function that creates another page when I
> > > have reached the bottom of a page. For some reason everytime I try to
> > > include a PDF_function call inside a function I get an out of scope
> > > error message. Like so:
> > >
> > > "Fatal error: PDFlib error: function 'PDF_begin_page' must not be
> > > called in 'page' scope"
> > >
> > > The function I created is below
> > >
> > > function next_page($throw)
> > > {
> > >     global $p;
> > >
> > >     if ($throw = "open")
> > >     {
> > >     PDF_begin_page($p, 600, 800);
> > >     return;
> > >     }
> > >
> > >     if ($throw = "close")
> > >
> > >
> > >     PDF_end_page($p);
> > >     return;
> > >     }
> > > }
> > >
> > > All I do is put in to var $throw open or close and its not
> > > working; $p is global, what am I doing wrong? Im really having a
> terrible
> > > time
> > > with scope and php, no calles from PDF seem to want to work inside a
> > > function. Thanks for any help you guys can give me. Im pulling my hair
> out.
> > > PHP is
> > > a great language but this scope stuff is givin me fits.
> > >
> > > Jeff
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to