Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Foldertype "Application"
#1
First of all i like to tell again how much i like QM, and im liking it more and more as i findout what all it can do!

So now i found this property in folder options called "Application"...
After haveing read the help about it, im still confused about it. (not enough info on subject)

Could you explain a bit more with examples on what its effects is and how to use it?
For example lets say i want to make an application (Like my current JobSystem) using this feature.

What i understood so far is that it is like creating a class but somehow different.
It says functions in this kind of folder, and subfolders, are not public.
That made me think: "Then how i ever start using it? If any function under it cant be accessed from outside..."
The topmost macro/function in that folder is always run when accessing any member(?), does this mean it is tobe used for class definitions?
Im so confused about this topic i cant even formulate real questions about it yet :lol:

FYI: I had made my JobSystem using seperate functions etc, and im rewriting it all tobe member functions of one main class (the application).
And i intend to have member functions for member functions of the main class if at all possible...

*edit*
Im sory to take so much time from you all the time, but i like to think this all also helps other users and potential users of QM to more understand posibilities and usages.
Well thats all for now, 3M
#2
This feature was added when QM still did not support thread variables, and now is not very useful. The main benefit was that you can use local variables of the main function in all functions of that app. You don't need global variables. These local variables are like global for your app, but not visible outside the app folder. Also, easier to debug functions, because when you click the Run button, always runs the main function, even if other function is opened.

Classes also is good way to have private data.

Quote:And i intend to have member functions for member functions of the main class if at all possible...
:?: Confusedhock:

Quote:Im sory to take so much time from you all the time, but i like to think this all also helps other users and potential users of QM to more understand posibilities and usages.

Yes, it helps others too. And helps me too Smile .
#3
Ok so for short that functionality is replaced by using private data in classes when the class is declared thread variable?
hmm ok...

Gintaras Wrote:
Quote:And i intend to have member functions for member functions of the main class if at all possible...
:?: Confusedhock:
Uhmm lets see how to explain that... :lol:

Like MainClass.FuncA(arg).FuncA1() syntax...
But i now remember you told me QM does not support that syntax...uhmmm.

Other explanation and usage would be private functions tobe used by public member functions of main class.
Like: MainClass.FuncA(arg), and then have FuncA() access FuncA1() which is not accessible useing MainClass.FuncA1().
Where FuncA() passes data to FuncA1(&arg), here &arg is adress of private data not accesible outside main class.
&arg could be adress of an element of an array which is a member of a private structure in main class.
(Hope this last line, explaining arg, is self explaning)

understand now? :lol: :wink:
Well thats all for now, 3M
#4
There are several ways how functions of members can be called.

Code:
Copy      Help
class Class1 a b
class Class2 Class1'c d ;;main class; a is member
class Class3 :Class1'c d ;;main class; derived from Class1 (inheritance)

Class2 x
x.FuncA
;or directly through member variable
x.c.FuncA1 ;;only if FuncA1 is public (set in Properties) and c is public (in class declaration without -)
;or use inheritance

Class3 y
y.FuncA1

Class2.FuncA
Code:
Copy      Help
c.FuncA1 ;;only if FuncA1 isn't private

Class1.FuncA1
Code:
Copy      Help
out 1
#5
uhmm i think you made some thinking errors there... :lol:
(or i mis-looked)
For good inherantacy should "class Class3 :Class1'c d" not be "class Class3 :Class1 c d" ?
because it looks like you are making a member c of type Class1 while at same time inhereting Class1 :?: :? Confusedhock:

Anyway to illustrate what i mean see the below:
(This is non-workable code because its a mix of QM and C++)
Code:
Copy      Help
class MainClass {
private:
,struct {
,,ARRAY(POINT) a;
,,int b;
,} a;
protected:
,int b;
,void FuncA1 = function(&arg) { out arg.x arg.y b; };
public:
,void FuncA = function(arg) { FuncA1( a.a[arg] ); };
} Class1;

Now user can only use Class1.FuncA(1) and have values output of private data...
Well thats all for now, 3M
#6
Quote:For good inherantacy should "class Class3 :Class1'c d" not be "class Class3 :Class1 c d" ?

In C++ it would be :public Class1, but in QM it is :Class1'c. In memory it is the same anyway, and in C++ too. And instaed of __super::FuncA1() you can use c.FuncA1().

The code in QM is
Code:
Copy      Help
class MainClass --TYPENAME'a b
MainClass class1

, and "Protected" is checked in MainClass.FuncA1 properties dialog.


Forum Jump:


Users browsing this thread: 1 Guest(s)