Global Variable Examples?

I’m trying to learn more about global variables. How to set them up, and utilize them. The amount of info that I’m finding on it is slim, and I’m not having any luck getting them to work in my LODB macros following said info.

I’m trying to get an ID from a table, and set it to a global, public, private variable, so that I can call on it from a different sub. I can get Const to work just fine, but that doesn’t help with trying to assign a global through the macro.

I think that I have an understanding on the differences between global, public, private, but even that I’m not sure of. Like I said, I’m not having much luck in finding info.

Can/will someone point me in a good direction? An example odb with non Const Globals would help out tremendously.

Thanks

This uses an ods

You do not provide any specifics about your problem. You ask others to provide you extensive teaching (because you are asking for an unspecified amount of information on a topic defined by a “name”), instead of showing a problem (“here is the (file with) code, it fails on line X with message Y, my expectation is Z, what is wrong?”), asking for a specific solution, and learning from that :slight_smile:

Normally, yes. In this instance I was really more interested in Information, not just to have something pointed out. A link, or an odb file if someone has anything. I respect your time, and would rather not have to ask any of you to sit here and teach me. That was my thought process anyways.

With the info that I have found combined with what @Wanderer provided I’m well on my way. (His example brought it together for me)

Thank you @Wanderer, this is just what I needed, when I needed it :laughing:

Actually you were lucky. I had already dismissed your topic as you neither named the programming language nor other details. But the tread I linked, was also updated today, so I could give you a quick link…
.
Sure, I can find out about your previous threads, so I may deduct you use BASIC on Windows, but usually I don’t do this kind of research.

I thank you, and the timing lol. I didn’t even think about what language. @mikekaganski is right for calling me out.

1 Like