×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Pls, help me with this problem... (original posted in dBase section)

Pls, help me with this problem... (original posted in dBase section)

Pls, help me with this problem... (original posted in dBase section)

(OP)
Hi everybody,

(dBase III Plus)
How would you guys check "if equal" a memory variable containing a word, created by a first pass of program, against ITSELF during the second (and the third, fourth, fifth,… infinite times) steps of program?
I tried to store the word to a (temp.var.) during the first pass, but happens that during the second, and subsequent steps, the (temp.var.) created is actualized (stores) with the new word!
Due to infinity times by this step, a counter, or different temp.var. would be impractical…

Any hint? bigears Thanks!
(sorry for my English…) sad

RE: Pls, help me with this problem... (original posted in dBase section)

Without a sample of your code's structure in those areas, my guess is that your temp variable is declared in a subroutine, then when it returns to a higher level the variable is discarded (as out of scope) and when you go back into that subroutine it's gone.

Can you declare the variable at a higher level of code so it doesn't go out of scope? Alternatively, you could declare the variable as PUBLIC ( PUBLIC TempVar ) so it would exist permanently until the program ends. Typically, declaring a temp variable as PUBLIC isn't considered good code, better to initialize it at a higher level, if possible.

If you need the variable to exist from one program or computer session to the next then you'd have to either write it into code or write it to a file to be read in the next time.

RE: Pls, help me with this problem... (original posted in dBase section)

(OP)
Thanks Mark,

Well, it happens a week ago and now I don’t remember exactly what the problem was. I do remember that I quit, waiting a help, and took another problem (this program has a LOT of problems...)
I do remember that the temp.var. was not in a subroutine and the level remained unchanged. I’m aware of levels, public var., privates and so on, but as I said, I don’t remember right now the problem. After that, I took more of less a dozen other issues, some was solved others not.
I’m working right now with the program, and when I change one thing, destroys another…

You will for sure listening of me, when I faced that problem again…

Thanks again Mark wink

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close