Search found 52 matches: publics

Return to advanced search

Re: Conversion from ca-clipper ( not found a variable)

Marc, If you use a Object, and want to see it everywhere, you will use the public not ? No, no PUBLICs. There are several ways to eliminate PUBLICS. Here is one: ---------------------------------------------------------- ELIMINATING PUBLICS Here is a sample showing how ...
by James Bott
Thu Mar 10, 2022 7:15 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Conversion from ca-clipper ( not found a variable)
Replies: 30
Views: 6743

Re: Conversion from ca-clipper ( not found a variable)

... since I only use database objects (e.g. oCustomer:name), and thus no variable type declaration is needed for field names. You can also eliminate PUBLICs using a database object. I think you are missing out on a lot by not working with OOP. I have taken old programs and reduced the code by more ...
by James Bott
Thu Mar 10, 2022 6:36 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Conversion from ca-clipper ( not found a variable)
Replies: 30
Views: 6743

Re: Usar o no variables publicas.

To All I only use Publics for defining System wide user roles .. Read, Write, Supervisor and Admin... Statics work fine in a .prg with many functions .. specifically if you need to update a Static value within your .prg and have visibility ...
by Rick Lipkin
Thu Mar 25, 2021 1:49 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: Usar o no variables publicas.
Replies: 16
Views: 4208

Re: Marc : Conversion process and questions about it

... in the oInvoice:New() method and it looks up the customer record and creates a oCustomer (singular) object inside the TInvoice class. I never use publics.
by James Bott
Mon Mar 15, 2021 6:41 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Marc : Conversion process and questions about it
Replies: 30
Views: 5264

public variables yes or not

... are visible only within prg where they are declared The privates are visible from the moment they are declared onwards to their execution The publics are visible throughout the program Locals only within your function where they are declared I see that we can use all types of variables in ...
by Otto
Wed Sep 23, 2020 7:27 am
 
Forum: mod_harbour
Topic: public variables yes or not
Replies: 0
Views: 436

Example Business Object (Customer)

... End(), Display() are used in many other objects. Encapsulation: This object looks up it's own data (and saves it too) in the customer table. No PUBLICS or PRIVATES are used. To instanitate this object all you need one line of code and the CustNo. oCustomer:= TCustomer():New(cCustNo) That's it! ...
by James Bott
Wed Jun 28, 2017 6:02 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Example Business Object (Customer)
Replies: 32
Views: 9593

Re: OT: MAPI -- Why it sometimes work, and sometimes doesn't ?

... that will override this behavior. I would change "PRIVATE oMail" to "LOCAL oMail" in your code. I never use PRIVATES or PUBLICS--too many issues. It forces you to encapsulate so you eliminate many hard to find bugs. Regards, James
by James Bott
Fri Jun 09, 2017 4:34 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: OT: MAPI -- Why it sometimes work, and sometimes doesn't ?
Replies: 7
Views: 2059

Re: Password protected access to menu. Advice ?

Here is a sample showing how you can eliminate publics. One disadvantage of using publics is that they have to be declared in every routine that uses them or you will get compiler warnings. Of course, since publics are visible everywhere you always ...
by Enrico Maria Giordano
Thu May 11, 2017 2:33 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Password protected access to menu. Advice ?
Replies: 25
Views: 4591

Re: Password protected access to menu. Advice ?

... their permissions, but also any user preferences, and then you can access them easily anywhere. This also has allowed me to eliminate the use of PUBLICs anywhere in my programs. I used to get name conflicts with PUBLICs that created bugs that were very hard to find. No more. Regards, James
by James Bott
Thu May 11, 2017 2:20 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Password protected access to menu. Advice ?
Replies: 25
Views: 4591

Re: Password protected access to menu. Advice ?

James Bott wrote:Here is a sample showing how you can eliminate publics. One disadvantage of using publics is that they have to be declared in every routine that uses them or you will get compiler warnings.


Or you can use them as

Code: Select all  Expand view  RUN
M -> varname


This has the advantage that you can easily locate them.

EMG
by Enrico Maria Giordano
Mon May 08, 2017 4:21 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Password protected access to menu. Advice ?
Replies: 25
Views: 4591

Re: Password protected access to menu. Advice ?

Here is a sample showing how you can eliminate publics. One disadvantage of using publics is that they have to be declared in every routine that uses them or you will get compiler warnings. Of course, since publics are visible everywhere you always ...
by James Bott
Mon May 08, 2017 2:52 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Password protected access to menu. Advice ?
Replies: 25
Views: 4591

Re: Ayuda en programa

... lenguaje compilado, puro, donde los simbolos y variable se reemplazan por su dirección en tiempo de compilación. De la misma forma que no existen PUBLICs ni PRIVATEs, me temo que eso no sería viable. Desconozco que problema quieres resolver con una macro, tal vez puedas usar metodos virtuales ...
by Carlos Mora
Fri May 13, 2016 7:01 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: Ayuda en programa
Replies: 20
Views: 4704

Re: PUBLIC var declaration issue

... outside the funtion it's been declared and add it to the function parameters. Maybe I actually could do both. First your way, declaring all the publics at the top of the file, then I would only get warnings for undeclared locals. Once I got all those declared, then I could remove the MEMVAR ...
by Carlos Mora
Tue Sep 01, 2015 11:18 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 7411

Re: PUBLIC var declaration issue

... but prefixing every public var use is going require probably tens of thousands of prefixes. And I won't be able to tell if a function is using publics just from looking at the top of the function. Using the MEMVAR statement would only require one change per function and I get the documentation. ...
by James Bott
Mon Aug 31, 2015 5:02 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 7411

Re: PUBLIC var declaration issue

... but it appears that it won't solve the issue I am trying to solve. Moving the MEMVAR to the top of everything will prevent warnings for undeclared PUBLICs, but that is not what I need. I am trying to get warnings for every undeclared variable used in every function. This forces me to declare all ...
by James Bott
Mon Aug 31, 2015 2:16 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 7411
Next

Return to advanced search