Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Feedback Please: .VCX vs .PRG
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00060795
Message ID:
00060903
Vues:
35
>>>My latest project involves 4 programmers, and we've opted to use PRGs for many items and a PROC file for a 'bunch' of small functions used repeatedly. We've found it's easier to keep the code up-to-date for all of us. Because of some system limitations, we have to send our code to one person who manages the Visual Source Safe, so checkouts are not totally reliable.
>>
>>I think the question was rather "classes in VCXs vs classes in PRGs" than "classes in VCX vs func/proc in PRGs".
>>
>>I totally agree that funcs/procs are still the easiest way to go for many small problems. I don't really see a good reason for defining classes in PRGs. Although, I heard that many programmers are doing this. So, I would like to hear some reasons for it.
>>
>>Vlad
>
>Vlad,
>
>One reason is that the memory required for PRGs is significantly less than VCXs. This is something that I had heard, but never tested until now. I created a simple class with one custom property and one custom method. Using SYS(1016), I measured how much memory was used by these objects. The PRG used approximately 11K less than the VCX. I test this twice, re-starting VFP each time with the same results.
>
>In general, I use both, depending strictly on what the class is designed to do and work with.
>
>George


George:

Have you found SYS(1016) to be reliable? After reading your post, I conducted a similar test.
I found that SYS(1016) changes after every line of code - regardless of whether objects
were created, variables were created, tables were opened... At startup, two consecutive ? SYS(1016)
returned different values. Subsequent ? SYS(1016) match the second value until another line
of code (RELEASE ALL, CLEAR ALL, HELP...) is issued in the command window. Then a new value is returned.

I created a form without any controls in a .PRG and in a .VCX I found that the SYS(1016) was
lower when SET CLASSLIB was issued than when SET PROC TO (by about 6K). However, when
oForm.Show() was issued, SYS(1016) was 2K lower for the object created from a .PRG.

Before each object was created, I restarted Fox - I didn't create them during the same session.
I checked SYS(1016) after each line of code but am a little confused about its results.
Any thoughts?

Dan
Dan
St. Petersburg, FL

"I started out with nothing and I still have most of it left"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform