Announcement

Collapse
No announcement yet.

Another wish list item

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Another wish list item

    Consider the following snippet:
    Code:
    Sub DoSomething         ' Applies to Functions as well
    
        Local Wheel as Long
        Incr Wheel
        ....Process
        ....Process
    
    End Sub
    Each time the program accesses this sub, "Wheel" gets reset to zero and would always have a value of one.

    There are times when I don't want this to happen. The only way I know of to keep incrementing "Wheel" in this sub to declare it GLOBAL(ly) earlier in the program.

    What I would like is to LOCAL(ly) declare a variable, as shown above but not reset it. It would apply exclusively to this procedure.

    Maybe an example:
    Code:
    Sub DoSomething
    
        Local (wheel) as long   ' or tag something in the line to keep the current value.
        Incr Wheel
        ....Process
        ....Process
    
    End Sub
    This would go a long way to cleaning up the start of code and after the procedure is set, I don't have to worry about it any more.


    BTW: I really LOVE the "Preview Post" button. Nice!
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

  • #2
    Wish Granted

    Look up STATIC in the help file.
    [SIZE="1"]Reprinted with correections.[/SIZE]

    Comment


    • #3
      Static Wheel as Long
      Engineer's Motto: If it aint broke take it apart and fix it

      "If at 1st you don't succeed... call it version 1.0"

      "Half of Programming is coding"....."The other 90% is DEBUGGING"

      "Document my code????" .... "WHYYY??? do you think they call it CODE? "

      Comment


      • #4
        Well.....Okay....That seems to work. Hmmm.... Much Grass.
        There are no atheists in a fox hole or the morning of a math test.
        If my flag offends you, I'll help you pack.

        Comment


        • #5
          BTW: I really LOVE the "Preview Post" button. Nice!
          You can say that two times

          BTW: I really LOVE the "Preview Post" button. Nice!

          (I previewed this, made 2 changes, previewed it again, then posted it. hehheh)

          Comment


          • #6
            Well.....Okay....That seems to work. Hmmm.... Much Grass.
            (my bold)

            What seems to work? Reading the manual or 'STATIC'? Both?

            How did this thread get this far without ?
            Rod
            I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

            Comment


            • #7
              RTFM
              Sometimes ya just don't make the connection, even if you did read the fine manual...twice. I think Eddie Awad said it well:
              -----------------
              1. Don’t use the acronym RTFM.
              2. Do point people to the documentation.
              3. Don’t blindly trust the documentation.
              4. Do test, test and test, even after you read the documentation.
              5. Don’t be afraid to ask dumb questions. What’s dumb to some, is genius to others.
              Feel free to add your own DO or DON’T, or even ask dumb questions, I promise I won’t throw an RTFM on you
              -----------------
              I agree Edward. No RTFM's from me neither.

              Comment

              Working...
              X