Gosub

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SOR

    Gosub

    I know I could use a function to get the same effect - but does php have
    any type of gosub commands .
  • Ken Robinson

    #2
    Re: Gosub



    SOR wrote:[color=blue]
    > I know I could use a function to get the same effect - but does php have
    > any type of gosub commands .[/color]

    No. Function are subroutines. If you don't want to return anything,
    don't.

    Stop thinking in BASIC.

    Ken

    Comment

    • SOR

      #3
      Re: Gosub

      <comp.lang.ph p , Ken Robinson , kenrbnsn@rbnsn. com>
      <1122225223.317 988.208470@g49g 2000cwa.googleg roups.com>
      <24 Jul 2005 10:13:43 -0700>
      [color=blue][color=green]
      > > I know I could use a function to get the same effect - but does php have
      > > any type of gosub commands .[/color]
      >
      > No. Function are subroutines. If you don't want to return anything,
      > don't.
      >
      > Stop thinking in BASIC.
      >[/color]

      I dont recall asking you what I should or shouldnt think .

      Comment

      • Peter Chant

        #4
        Re: Gosub

        SOR wrote:
        [color=blue][color=green]
        >> Stop thinking in BASIC.
        >>[/color]
        >
        > I dont recall asking you what I should or shouldnt think .[/color]

        I think that the antithesis felt toward BASIC is just the way gosub and goto
        fight against writing a structured program.

        Of course you could use the arithmetic IF statements of FORTRAN 66 or that
        fact that you can have multiple entry and exit points allowed for functions
        and subroutines in FORTRAN to take some of the heat off of BASIC!

        Pete

        --

        Comment

        • Ken Robinson

          #5
          Re: Gosub



          SOR wrote:
          [color=blue][color=green]
          > >
          > > Stop thinking in BASIC.
          > >[/color]
          >
          > I dont recall asking you what I should or shouldnt think .[/color]

          Sorry, what I meant by that statment is that since you're trying to
          learn a new language, don't try to write code the way you did in
          another language. Since you mentioned gosub, I assumed you know BASIC
          and that's how you're trying to program. You can use the concepts from
          other languages, but learn to use the powers of whatever language you
          use.

          I remember seeing someone who created enough macros in C so he could
          make his C code look like Fortran. It may have been a good execise for
          the mind, but it's not good for production coding.

          Ken

          Comment

          • SOR

            #6
            Re: Gosub

            <comp.lang.ph p , Ken Robinson , kenrbnsn@rbnsn. com>
            <1122253032.851 874.237250@g49g 2000cwa.googleg roups.com>
            <24 Jul 2005 17:57:12 -0700>
            [color=blue][color=green][color=darkred]
            > > > Stop thinking in BASIC.
            > > >[/color]
            > >
            > > I dont recall asking you what I should or shouldnt think .[/color]
            >
            > Sorry, what I meant by that statment is that since you're trying to
            > learn a new language, don't try to write code the way you did in
            > another language. Since you mentioned gosub, I assumed you know BASIC
            > and that's how you're trying to program.[/color]

            I know several variants of basic - I asked a question if there was any
            alternative ways to do it using php and thats all that type of question
            is .

            BTW: does anybody on here ever ask for a site critique after they finish
            writing a script ? .

            It seems a bit curious that a newsgroup full of php geeks and would be
            php geeks dont really give details of any new stuff they do , Although
            in part I suppose thats because some users on here only really write or
            do stuff for other people and NDA could apply or whatever .

            Comment

            • Ken Robinson

              #7
              Re: Gosub



              SOR wrote (in part):[color=blue]
              > BTW: does anybody on here ever ask for a site critique after they finish
              > writing a script ? .
              >
              > It seems a bit curious that a newsgroup full of php geeks and would be
              > php geeks dont really give details of any new stuff they do , Although
              > in part I suppose thats because some users on here only really write or
              > do stuff for other people and NDA could apply or whatever .[/color]

              I've seen some requests for critiques here. The biggest problems is
              that, unless you post the code, there's no way to critique the original
              PHP code, we can only critique the final results.

              Another site that has a good PHP forum is <http://www.tek-tips.com/>.

              Ken

              Comment

              • SOR

                #8
                Re: Gosub

                <comp.lang.ph p , Ken Robinson , kenrbnsn@rbnsn. com>
                <1122259551.174 751.298960@z14g 2000cwz.googleg roups.com>
                <24 Jul 2005 19:45:51 -0700>
                [color=blue][color=green]
                > > BTW: does anybody on here ever ask for a site critique after they finish
                > > writing a script ? .
                > >
                > > It seems a bit curious that a newsgroup full of php geeks and would be
                > > php geeks dont really give details of any new stuff they do , Although
                > > in part I suppose thats because some users on here only really write or
                > > do stuff for other people and NDA could apply or whatever .[/color]
                >
                > I've seen some requests for critiques here. The biggest problems is
                > that, unless you post the code, there's no way to critique the original
                > PHP code, we can only critique the final results.[/color]

                Then flex your fingers and wet your lips old chap as this newbie will be
                asking in a couple of days and i'm quite looking forward to seeing my
                code ripped to pieces and thrashed to within a inch of its life :-)
                [color=blue]
                > Another site that has a good PHP forum is <http://www.tek-tips.com/>.
                >[/color]

                Thanks for that .

                Comment

                • Steve

                  #9
                  Re: Gosub

                  On Sun, 24 Jul 2005 22:29:37 +0100, Peter Chant wrote:
                  [color=blue]
                  > SOR wrote:
                  >[color=green][color=darkred]
                  >>> Stop thinking in BASIC.
                  >>>
                  >>>[/color]
                  >> I dont recall asking you what I should or shouldnt think .[/color]
                  >
                  > I think that the antithesis felt toward BASIC is just the way gosub and
                  > goto fight against writing a structured program.
                  >
                  > Of course you could use the arithmetic IF statements of FORTRAN 66 or that
                  > fact that you can have multiple entry and exit points allowed for
                  > functions and subroutines in FORTRAN to take some of the heat off of
                  > BASIC!
                  >
                  > Pete[/color]
                  Well, I know Fortran 2, 4 and 77 ( with blocked if statements at last! ),
                  but not 66.

                  Steve

                  Comment

                  • Geoff Berrow

                    #10
                    Re: Gosub

                    I noticed that Message-ID:
                    <MPG.1d4e67d376 ae8070989d88@no-cancel.newsread er.com> from SOR contained
                    the following:
                    [color=blue]
                    >Then flex your fingers and wet your lips old chap as this newbie will be
                    >asking in a couple of days and i'm quite looking forward to seeing my
                    >code ripped to pieces and thrashed to within a inch of its life :-)[/color]

                    You tend to get a good response if it captures the imagination. I got
                    quite a good response with my bingo problem. If you just want people to
                    help you clean up your code I suspect the response may not be all you
                    hope for.

                    --
                    Geoff Berrow (put thecat out to email)
                    It's only Usenet, no one dies.
                    My opinions, not the committee's, mine.
                    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                    Comment

                    • Peter Chant

                      #11
                      Re: Gosub

                      Steve wrote:

                      [color=blue]
                      > Well, I know Fortran 2, 4 and 77 ( with blocked if statements at last! ),
                      > but not 66.[/color]

                      I think 66 may be another name for IV. I've not used it, I learnt 77, but
                      it is mentioned in one of my reference books.

                      Pete

                      --

                      Comment

                      • Shelly

                        #12
                        Re: Gosub


                        "Peter Chant" <pete@petezilla .co.uk> wrote in message
                        news:3kk1qkFtso fmU1@individual .net...[color=blue]
                        > Steve wrote:
                        >
                        >[color=green]
                        >> Well, I know Fortran 2, 4 and 77 ( with blocked if statements at last! ),
                        >> but not 66.[/color]
                        >
                        > I think 66 may be another name for IV. I've not used it, I learnt 77, but
                        > it is mentioned in one of my reference books.[/color]

                        Wow! There are people out there almost as old as me. I learned programming
                        on the job with Fortran 4. Take that stack of punched cards and submit it
                        in the morning. Hopefully you get it back by the end of the day just in
                        time to make the corrections and submit it overnight for the next morning to
                        fix early and repeat again. We had TWO IBM 7094s hooked together for an
                        amazing 64K memory!

                        There were no blocked ifs so you HAD to write spaghetti code. After the
                        intro of Fortran 77, with the exception of (ugh!) Basic, I think I wrote a
                        grand total of 5 gotos over the next almost three decades.

                        Shelly


                        Comment

                        • JDS

                          #13
                          Re: Gosub

                          On Mon, 25 Jul 2005 04:07:54 +0100, SOR wrote:
                          [color=blue]
                          > Then flex your fingers and wet your lips old chap as this newbie will be
                          > asking in a couple of days and i'm quite looking forward to seeing my
                          > code ripped to pieces and thrashed to within a inch of its life :-)[/color]

                          Then you may want to drop a bit of the defensive over-sensitivity.

                          --
                          JDS | jeffrey@example .invalid
                          | http://www.newtnotes.com
                          DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

                          Comment

                          • SOR

                            #14
                            Re: Gosub

                            <comp.lang.ph p , JDS , jeffrey@example .invalid>
                            <pan.2005.07.25 .18.11.31.63948 9@example.inval id>
                            <Mon, 25 Jul 2005 14:11:31 -0400>
                            [color=blue][color=green]
                            > > Then flex your fingers and wet your lips old chap as this newbie will be
                            > > asking in a couple of days and i'm quite looking forward to seeing my
                            > > code ripped to pieces and thrashed to within a inch of its life :-)[/color]
                            >
                            > Then you may want to drop a bit of the defensive over-sensitivity.
                            >[/color]

                            Perhaps your right and I should do as you did and seek out my feminine
                            side :-)

                            Comment

                            • Shelly

                              #15
                              Re: Gosub


                              "SOR" <webmaster@spar esorrepair.co.u k.INVALID> wrote in message
                              news:MPG.1d4f3e ddbd8536d3989d9 0@no-cancel.newsread er.com...[color=blue]
                              > <comp.lang.ph p , JDS , jeffrey@example .invalid>
                              > <pan.2005.07.25 .18.11.31.63948 9@example.inval id>
                              > <Mon, 25 Jul 2005 14:11:31 -0400>
                              >[color=green][color=darkred]
                              >> > Then flex your fingers and wet your lips old chap as this newbie will
                              >> > be
                              >> > asking in a couple of days and i'm quite looking forward to seeing my
                              >> > code ripped to pieces and thrashed to within a inch of its life :-)[/color]
                              >>
                              >> Then you may want to drop a bit of the defensive over-sensitivity.
                              >>[/color]
                              >
                              > Perhaps your right and I should do as you did and seek out my feminine
                              > side :-)[/color]

                              With an attitude like that, and with comments like that (even with a
                              smiley), you'll be lucky to get help anywhere. You are, after all, the one
                              seeking help.

                              Shelly


                              Comment

                              Working...