Usar o no variables publicas.

Re: Usar o no variables publicas.

Postby Enrico Maria Giordano » Thu Mar 25, 2021 8:39 pm

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
User avatar
Enrico Maria Giordano
 
Posts: 8402
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Usar o no variables publicas.

Postby jvtecheto » Thu Mar 25, 2021 8:52 pm

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
Fwh 19.06 32 bits + Harbour 3.2dev(r2104281802) + Borland 7.4 + FivEdit
User avatar
jvtecheto
 
Posts: 577
Joined: Mon Mar 04, 2013 4:32 pm
Location: Spain

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 111 guests