Help with module logik #20173
-
I have a "bigger" script in the following form:
For the next time i will often change some parameter on the object initialisation. I do not want to edit the big file on a smartphone while being in the field.
if i do so, i got the compiling error message: "module 'SensorAktorModul' has no member 'ObjectA'". thx, again, and again, ... |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
You need to do something like The module does not automatically gets all declared objects but only those that you explicitly add. |
Beta Was this translation helpful? Give feedback.
-
I have now tried to reduce the project as much as possible and filled the few methods with print statements. Basically, my question is simple. I would like to have everything from the definition of class Taster : Sensor... end in another file. If I understand you correctly, all the suggestions made have the consequence that I would also have to maintain the objects in the SensorAktor.be. That's exactly what I wanted to avoid.
|
Beta Was this translation helpful? Give feedback.
-
your example:
i did this in another project in a sligthly different style - with no return:
what differents makes the return? |
Beta Was this translation helpful? Give feedback.
-
this results in an error:
|
Beta Was this translation helpful? Give feedback.
Does that mean all of classes Aktor, Licht, Sensor and Taster? Assuming yes.
You did not show where you stumbled.... Anyway, if all you want is to be able to create instances of classes, without the module as such housing data, one approach would be to let the module be a singleton only able to create class instances, like this:
And then code like
var l_wohnz = mymodule.Licht(1, 'Name1')
As the
Licht
…