Search found 49 matches: privates

Return to advanced search

Re: How to create a PRIVATE variable owned by the caller?

Enrico, Why are you using a PRIVATE? I haven't used PRIVATEs for years. You can do the same thing you wanted this way: FUNCTION MAIN()    LOCALE cName:=""    cName:= CREATEVAR( cName, "Hello" )    ? cName // it exists ...
by James Bott
Wed Jan 11, 2023 11:47 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: How to create a PRIVATE variable owned by the caller?
Replies: 21
Views: 778

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

... DECLARE: FIELD, LOCAL, MEMVAR, PRIVATE (I don't use it much) I prefer MEMVAR in Combination with PRIVATE, of course, I don't make excessive use of PRIVATES and PUBLIC, I use it only in exceptional cases. The only one that I'm not used to using, because I don't understand how it works, is GLOBAL. ...
by karinha
Wed Mar 02, 2022 9:32 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Conversion from ca-clipper ( not found a variable)
Replies: 30
Views: 4344

public variables yes or not

... in any PRG you run? You mixed like different concepts Explain me please. Static variables 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 ...
by Otto
Wed Sep 23, 2020 7:27 am
 
Forum: mod_harbour
Topic: public variables yes or not
Replies: 0
Views: 271

Re: Usar o no variables publicas.

... lo que más te guste o más práctico sea para ti. En nuestro querido y viejo clipper había unos límites fáciles de alcanzar de variables públics y privates en la TABLA DE SÍMBOLOS, pero esa limitación ya no existe en Harbour. Personalmente por inercia tampoco las utilizo, pero me reitero sólo por ...
by xmanuel
Tue Apr 28, 2020 9:48 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: Usar o no variables publicas.
Replies: 16
Views: 3036

Re: Referencing a dialog from a different class ?

Tim, First you don't ever HAVE to use Privates. I haven't used them in 15 or 20 years. There is always a another way. Privates are always going to be a source of hard to find and seemly random errors. So if I understand this correctly, you have ...
by James Bott
Tue Sep 26, 2017 8:51 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Referencing a dialog from a different class ?
Replies: 11
Views: 2303

Example Business Object (Customer)

... 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! Now you ...
by James Bott
Wed Jun 28, 2017 6:02 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Example Business Object (Customer)
Replies: 32
Views: 8531

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

... There are programs 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: 1878

Re: Ayuda en programa

... 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 si estas haciendo ...
by Carlos Mora
Fri May 13, 2016 7:01 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: Ayuda en programa
Replies: 20
Views: 4030

Re: ADO RDD xHarbour

Antonio, Would you mind uploading the new version (with the LOCALs) declared to Github? As you know, unless they are declared they are PRIVATEs, so I don't want to do a lot of testing when PRIVATEs may be visible outside the RDD. I know, I could declare them myself, but then I would still ...
by James Bott
Wed Oct 14, 2015 8:34 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: ADO RDD xHarbour
Replies: 1047
Views: 446349

Re: PUBLIC var declaration issue

Carlos, May be it's not so easy. It depends on how vars are being used: a LOCAL can't replace a PRIVATE, because the scope of PRIVATEs go beyond the current function to the called ones. Fortunatelly in your case every var has it's own (weird) name, so it will be easy to find the usage ...
by James Bott
Tue Sep 01, 2015 1:38 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 6344

Re: PUBLIC var declaration issue

... at the top of the function. May be it's not so easy. It depends on how vars are being used: a LOCAL can't replace a PRIVATE, because the scope of PRIVATEs go beyond the current function to the called ones. Fortunatelly in your case every var has it's own (weird) name, so it will be easy to find ...
by Carlos Mora
Tue Sep 01, 2015 11:18 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 6344

Re: PUBLIC var declaration issue

... the MEMVAR declarations and get warnings for all the publics. I will write some test code to try this out. Hmm, I haven't even thought about privates yet. Your thoughts? James
by James Bott
Mon Aug 31, 2015 2:16 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 6344

Re: PUBLIC var declaration issue

... nil Some time ago I was in the same situation as yours, compiling other's people code, with very 'arguably' coding style, and as PUBLICs and PRIVATEs are not very familiar to me, I had to learn how to deal with them. May be an approach to a solution can be to create a ch header with all the ...
by Carlos Mora
Mon Aug 31, 2015 8:38 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 6344

Re: PUBLIC var declaration issue

... and for me it is very difficult to understand, so the more documentation in the code, the better. Since it is still using PUBLICs and (I think) PRIVATEs, it has the problem that it is very fragile and can easily be broken. And those kinds of bugs are very hard to track down because they are ...
by James Bott
Sun Aug 30, 2015 9:43 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 6344

Re: PUBLIC var declaration issue

... don't want automatic memvar declarations since I am trying to document all vars used in each function. This is mainly so I can look for locals and privates that may be overriding publics. As I am sure you know these situations can be nightmares producing bugs that are extremely hard to find. Since ...
by James Bott
Sun Aug 30, 2015 3:14 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: PUBLIC var declaration issue
Replies: 26
Views: 6344
Next

Return to advanced search