Which one consume more memory?

limhyeam

Member
Something just pops up in my mind.

When I was creating a form with a lot of controls in the module, I was wondering whether if I were to do it statically or dynamically.

The thing is that I want to do a/several forms dependings on the number of items I have in a list. I know roughly the limit of the items in the list hence, I know how many forms I can create for my application. But, question is that, if I do it dynamically, I need to write the code to generate a lot of controls dynamically, and unfortunately there was no duplicate function for the form, which allow me to copy the template of my form as many as I want. :BangHead:

Then, I was thinking of predefined several forms for usage (3 forms mostly). One question pops up in my mind, this will consume more memory. But, comparing to the code and dynamically generating the controls with the code, I was wondering whether it is worth it or not.
 

agraham

Expert
Licensed User
Longtime User
unfortunately there was no duplicate function for the form, which allow me to copy the template of my form as many as I want.
You might try designing the form in a module, then you can copy and rename the module and add it to the project as an existing module as many time as you need.

One question pops up in my mind, this will consume more memory.
For just a few forms I wouldn't worry about memory use, just do what is most elegant/convenient.
 

tsdt

Active Member
Licensed User
Thanks Agraham.

The reason I was a bit worry is that, if we were to develop an application in a handheld device with a memory limitation, we might face some problems with having too much duplicated modules, instead of just forms in a module.

Does B4PPC do any code optimization automatically if they found out that the code are not being used at all?

The proposal you gave, I think more for convenience than for elegant.
 

agraham

Expert
Licensed User
Longtime User
For the number of three forms you quoted I don't believe there is any possibility of that causing a memory limitation on a device. Anyway there will be no difference in memory use by having the same number of forms in one module or in individual modules. A module is a mechanism for code separation and carries no memory overhead.
 

tsdt

Active Member
Licensed User
Thanks Agraham again.

I get your meaning now. So, correct me if I am wrong, B4PPC allows having an empty module (without any code), but, with a form attached to that module. Then, we can access to the other forms via a main module. Is that correct??
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…