Search found 38 matches: avars

Return to advanced search

Re: hash with (x)harbour - knowledge base

James Bott wrote:Maurizio,

I don't understand this syntax. Please explain.

Local aVars := {=>}

What is {=>} ?

Does that preprosses into something else?

James


No, it is the regular syntax required to initialize an empty hash (ie. similar to aVars := {} for arrays).

EMG
by Enrico Maria Giordano
Wed Sep 22, 2010 2:46 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: hash with (x)harbour - knowledge base
Replies: 20
Views: 7932

Re: hash with (x)harbour - knowledge base

Maurizio,

I don't understand this syntax. Please explain.

Local aVars := {=>}

What is {=>} ?

Does that preprosses into something else?

James
by James Bott
Wed Sep 22, 2010 2:35 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: hash with (x)harbour - knowledge base
Replies: 20
Views: 7932

Re: hash with (x)harbour - knowledge base

... see where you are using a hash? Did you know that the equivalent of scatter and gather is built into database objects. And instead of refering to aVars[1], you can refer to oCust:name. This makes the code much easier to write and read. There are lots of other good reasons to use database objects. ...
by James Bott
Tue Sep 21, 2010 11:20 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: hash with (x)harbour - knowledge base
Replies: 20
Views: 7932

Re: hash with (x)harbour - knowledge base

Hello Otto I use Hash for manage the database Function Scatter() Local aVars := {=>} LOcal nField := FCount() LOcal nX := 1 FOR nX := 1 TO nField aVars[FIELDNAME(nX)] := FieldGet(nX) NEXT Return aVars Function Gather(aVars) lOCAL Nx := 1 FOR Nx := 1 TO LEN(aVars) ...
by Maurizio
Tue Sep 21, 2010 7:06 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: hash with (x)harbour - knowledge base
Replies: 20
Views: 7932

Source not compiling.

... #include "Dbstruct.ch" #translate Gather(<a>) => AEVAL(<a>, {|x, i| FIELDPUT(i, <a>\[i\]) }) FUNCTION Scatter (aVars, lBlank) LOCAL nSize := FCOUNT(), aDBStruct, cFieldType aVars := ARRAY(nSize) IF lBlank aDBStruct := DBSTRUCT() AEVAL(aVars, {|x, nI| aVars[nI] ...
by HunterEC
Tue Nov 17, 2009 4:23 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Source not compiling.
Replies: 3
Views: 627

Strange program behavior...

... (4096 * 3) #define NSPLIT_LINES 25000 #include "Common.ch" #include "FiveWin.ch" FUNCTION Main (cFile) #define nHandle aVars[1] #define cInFile aVars[2] #define cOutFile aVars[3] #define nPieces aVars[4] #define nLineCtr aVars[5] #define nTotLines aVars[6] #define nI ...
by HunterEC
Thu Nov 05, 2009 3:04 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Strange program behavior...
Replies: 4
Views: 888

Re: FICHEROS .MEM

Luis, Yo uso una array para todas las variables en mis aplicaciones, ARCHIVO DE CABECERA <CH> // Array de Variables MEMVAR aVarPublics // Definicion de Variables #define VARIABLE...1 aVarPublics[ 1 ] #define VARIABLE...2 aVarPublics[ 2 ] ....... #define VARIABLE...n aVarPublics[ n ] ...... #de...
by albeiroval
Tue Oct 20, 2009 3:07 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: FICHEROS .MEM
Replies: 4
Views: 775

Re: Problema con uso del Hash .....

I think that
LOCAL aVars := {=>}
is only for xHarbour not for harbour , you have to chek how works HASH for HArbour

Regards Maurizio
by Maurizio
Wed Jan 14, 2009 5:57 pm
 
Forum: FiveWin para Pocket PC
Topic: Problema con uso del Hash .....
Replies: 3
Views: 721

... the date in a hash . Regards Maurizio //-------------------------------------------------------------------------- Function MAin() Local aVArs USE "CLI01.dbf" aVars := LoadDbf() aVars:CODPRO := "ABCD" SaveDbf(aVars) use Return nil Function ...
by demont frank
Mon Dec 22, 2008 12:33 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: A much faster Class TDataBase !!!
Replies: 18
Views: 7273

... simulate Scatter and gather of the record //------------------------------------------------------------------------- FUNCtion Scatter() Local aVars := {=>} LOcal nField := FCount() LOcal nX := 1 FOR nX := 1 TO nField aVars[FIELDNAME(nX)] := FieldGet(nX) NEXT RETURN aVars Function Gather(aVars) ...
by Maurizio
Fri Sep 26, 2008 6:36 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: estructura de datos
Replies: 11
Views: 3548

Problem with Editor of Source

... case valtype(valor)="D";valor:=dtoc(valor) case valtype(valor)="L";valor:=if(valor,"T","F") Endcase retu valor STATIC Func acomodar(cLine) Local aVars,j,variable,valor,n IF (n:=AT("//",cLine))>0 cLine:=SUBS(cLine,1,n-1) ENDIF Do case case (n:=AT("++",cLine))>0;cLine:=SUBS(cLine,1,n-1)+"="+SUBS(cLine,1,n-1)+"+1" ...
by Vladimir Zorrilla
Wed Jun 18, 2008 10:37 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Problem with Editor of Source
Replies: 1
Views: 1530

Editor de Codigo con syntaxis coloreada interperte y texto i

... case valtype(valor)="D";valor:=dtoc(valor) case valtype(valor)="L";valor:=if(valor,"T","F") Endcase retu valor STATIC Func acomodar(cLine) Local aVars,j,variable,valor,n IF (n:=AT("//",cLine))>0 cLine:=SUBS(cLine,1,n-1) ENDIF Do case case (n:=AT("++",cLine))>0;cLine:=SUBS(cLine,1,n-1)+"="+SUBS(cLine,1,n-1)+"+1" ...
by Vladimir Zorrilla
Wed Jun 18, 2008 10:29 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: Editor de Codigo con syntaxis coloreada interperte y texto i
Replies: 1
Views: 2166

... una solución es cambiarlas por una única (ó varias) variables tipo array: public uno, dos, tres, cuatro, cinco, seis se cambiaría a: public aVars y aVars se haría igual a { <valor de uno>, <valor de dos>, ..., etc } Si generas un error en la aplicación (por ejemplo, escribe x++) ...
by Antonio Linares
Thu Jul 05, 2007 5:55 pm
 
Forum: FiveWin para CA-Clipper
Topic: error 332
Replies: 3
Views: 1036

Tengo un array (aVars) que contiene (campo,valor,tipo) de un tabla de mysql que sus valores depende del nombre de la tabla que le pasemos, entonces mi idea es, si por ejemplo, la tabla tiene los campos: id,idEmpresa,codigo,descripcion ...
by softruz
Fri Jun 01, 2007 8:02 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: Duda sobre HBClass
Replies: 5
Views: 944

Duda sobre HBClass

... varTOclass() class CDIt local nScope nScope := 1 ::s_oClass := IIF(.F.,,HBClass():new("tAux",__CLS_PARAM ( "TControl" ) ) ) for i = 1 to len(::aVars) ::s_oClass:AddMultiData(,::aVars[i,2] ,iif(.F.,1,iif(.F.,2,iif(.F.,4,nScope) ) ) + iif(.F.,16,0 ),{::aVars[i,1]},.F.,.F. ) next ::s_oClass:Create() ...
by softruz
Fri Jun 01, 2007 7:38 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: Duda sobre HBClass
Replies: 5
Views: 944
PreviousNext

Return to advanced search