FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Usar o no variables publicas.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Usar o no variables publicas.
Posted: Thu Mar 25, 2021 08: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
Posts: 607
Joined: Mon Mar 04, 2013 04:32 PM
Re: Usar o no variables publicas.
Posted: Thu Mar 25, 2021 08:52 PM
goosfancito wrote:
Code (fw): Select all Collapse
en el modulo inicial
PUBLIC hGlobal := {=>}
hGlobal[ "userid" ] :=
hGlobal[ "userlevel" ] :=
hGlobal[ "usermodules" ] :=


esto me da error al compilar con harbour
Code (fw): Select all Collapse
#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 24.07 64 bits + Harbour 64 bits 3.2dev(r2407221137) + MSVC64

Continue the discussion