Page 2 of 2

Re: Usar o no variables publicas.

PostPosted: Thu Mar 25, 2021 8:39 pm
by Enrico Maria Giordano
Rick Lipkin wrote:even statics need to be released with nil


This is not true. STATIC variables can't be released as they have static lifetime.

Rick Lipkin wrote:I also believe Locals execute faster at run-time.


I don't think so. STATIC variables are created at program startup and automatically released at the program end, while LOCAL variables are created each time the function is called and automatically released when the function returns.

EMG

Re: Usar o no variables publicas.

PostPosted: Thu Mar 25, 2021 8:52 pm
by jvtecheto
goosfancito wrote:
Code: Select all  Expand view

en el modulo inicial
PUBLIC hGlobal := {=>}
hGlobal[ "userid" ] :=
hGlobal[ "userlevel" ] :=
hGlobal[ "usermodules" ] :=
 


esto me da error al compilar con harbour
Code: Select all  Expand view

#include "fivewin.ch"

public hGlobal:= {=>}

FUNCTION main()
   hGlobal["uno"]:= "valor agregado"

   ? hGlobal["uno"]
   

   RETURN NIL


Source\clases\main.prg(15) Error E0001 Statement not allowed outside of procedure or function
Hola gustavo

Cambia Por

públic hGlobal

Saludos.

Jose

Enviado desde mi POCOPHONE F1 mediante Tapatalk