local variables


Closed Thread
Results 1 to 3 of 3

Thread: local variables

  1. #1
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289

    Default local variables

    I wish to use local variables...

    There must be a structure to mark parts of code to use local variables. It must be possible to use the same variable-name in different subroutines without using the same ram-location.
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  2. #2
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Talking

    Hey ... wasup ???? sleeping ????

    I think local variables are easy to implement !

    like:

    startlocal I

    (by now, the compiler adds a incrementing number to the variable, here it will be feg: loc_I_1)

    endlocal I

    (...it is lost...)

    The compiler has a seperat RAM-Locationlist for all this local variables and they are used like a stack... If Var1, var2 and var3 are used, var3 may be cleared, so var4 gets the same adress as var3...
    This will not be the best, but I think it is a first way...
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  3. #3
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    It must be possible to use the same variable-name in different subroutines without using the same ram-location

    Yikes! - I know that if I used the same variable name, but different subs changed different RAM locations, I'd get hopelessly lost in writing any code at all!

Similar Threads

  1. Internet-Ethernet and Local Net
    By Ioannis in forum General
    Replies: 15
    Last Post: - 7th January 2008, 21:16
  2. Variables not appearing in Watch Window MPLabv7.3
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th June 2006, 14:36
  3. How to tell which PICs can handle 16 bit variables?
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st August 2005, 08:44
  4. edit names of variables
    By mischl in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th January 2005, 21:00
  5. Problems with variables
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2004, 18:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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