472,958 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

how to create a pointer, or is there a better solution ?

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
Oct 13 '07 #1
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
Oct 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
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;
6
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...
52
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...
16
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...
18
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 ==...
11
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...
23
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...
4
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...
5
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 --...
0
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=()=>{
2
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...
2
isladogs
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...
2
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...
4
NeoPa
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 :...
3
NeoPa
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...
1
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...
0
isladogs
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...
2
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.