hello,
I've a program where users can make modules,
by just dumping them in a certain directory,
then they will dynamically link into the program if needed.
One of the communication channels I use,
is a general global file, which should be imported by all user modules.
One of the things a user should be able to do is to create " global
variables",
which should then be available in all the other program modules.
So the global file contains a list, call JAL_Globals = [],
where each user can append the globals he want to be exposed to the
outside world (for read only).
Now if these globals are complex items, no problem, I get pointers and
can access them.
But if these variables are simple, like integers, I get the value only
once ;-)
How can I create of dynamic pointers, even to simple variables ?
Or is there a better way ?
thanks,
Stef Mientki 1 1146
stef mientki schrieb:
hello,
I've a program where users can make modules,
by just dumping them in a certain directory,
then they will dynamically link into the program if needed.
One of the communication channels I use,
is a general global file, which should be imported by all user modules.
One of the things a user should be able to do is to create " global
variables",
which should then be available in all the other program modules.
So the global file contains a list, call JAL_Globals = [],
where each user can append the globals he want to be exposed to the
outside world (for read only).
Now if these globals are complex items, no problem, I get pointers and
can access them.
But if these variables are simple, like integers, I get the value only
once ;-)
How can I create of dynamic pointers, even to simple variables ?
Or is there a better way ?
Don't use a list, use a dictionary that has names mapped to values. Then
the problem goes away, because instead of mutating an object (which you
still can do), you can also rebind a new one -e.g like this:
JAL_Globals['name'] += 100
Diez This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jacek Dziedzic |
last post by:
Hi!
Say a have a class called black_box which, among other
things, contains an array of cells like this:
class black_box {
private:
// ...
public:
black_box_details_struct details;
|
by: Shankar |
last post by:
Hello,
We have a smart pointer class which provides the dereference
operator -> to access the underlying object pointer. Now, we have a new
requirement where a different type of object (e.g from...
|
by: Douglas Garstang |
last post by:
I can't believe I've been trying to work this out for hours now, and I
can't believe I couldn't find someone asking for a similar solution in
the newsgroups. No wonder I hate C so much, and every...
|
by: jose_luis_fdez_diaz_news |
last post by:
Hi,
If I don't include <libgen.h> I get then warnig below in regcmp call:
warning: improper pointer/integer combination: op "="
but if I include it the warning is not shown, but them program...
|
by: hzmonte |
last post by:
typedef int t_compare_func(const void *, const void *);
struct node *tree_search(struct node *root, const void *keyy,
t_compare_func *comp)
{
struct node *cur_item;
int result;
if (root ==...
|
by: Brian |
last post by:
Dear Programmers,
I have a class with a pointer to an array. In the destructor, I just
freed this pointer. A problem happens if I define a reference to a
vector of this kind of class. The...
|
by: sandy |
last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory',
within my class Directory (Can you already smell disaster?)
Each Directory can have subdirectories so I thought to put these...
|
by: etuncer |
last post by:
Hello All,
I have Access 2003, and am trying to build a database for my small
company. I want to be able to create a word document based on the data
entered through a form. the real question is...
|
by: Soumen |
last post by:
Hi,
I've requirement to observe a raw pointer (i.e. I should be able to
query if the pointer I'm using is still valid or not but when the
observer goes out of scope, the resource -- memory --...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| | |