FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveMac / FivePhone (iPhone, iPad) several get's in a loop
Posts: 166
Joined: Wed Nov 25, 2015 07:13 PM
several get's in a loop
Posted: Wed Nov 23, 2016 09:48 PM
Hello Antonio,

I use the CreatBlock function for some FOR-Next loops to build screens. Now I want to use it to get the value of several get properties in a loop. However I don't get this to work. Any suggestions? Here is what I use now:

Code (fw): Select all Collapse
PUBLIC aGegevenTekst[0][2]

AADD(aGegevenTekst, {'bloemkleur', ''})
AADD(aGegevenTekst, {'kleur kelk', ''})
AADD(aGegevenTekst, {'kleur kroon', ''})
AADD(aGegevenTekst, {'bloeivorm', ''})
AADD(aGegevenTekst, {'bloeitijd', ''})
AADD(aGegevenTekst, {'hoogte', ''})
AADD(aGegevenTekst, {'hoogte na 10 jr', ''})
AADD(aGegevenTekst, {'hoogte na 25 jr', ''})
AADD(aGegevenTekst, {'hoogte blad', ''})
AADD(aGegevenTekst, {'hoogte bloem', ''})
AADD(aGegevenTekst, {'breedte', ''})
AADD(aGegevenTekst, {'groeiwijze', ''})
AADD(aGegevenTekst, {'blad/loof', ''})


    nRowPaint := 325
    nColumn := 0
    FOR n = 1 TO 13
        oGetName := 'oGetFilter' + ALLTRIM(STR(n))
        cGetVar := aGegevenTekst[n,2]
        @ nRowPaint, nColumn SAY oSay PROMPT aGegevenTekst[n,1] OF oFld:aDialogs[ 2 ] SIZE 100, 20
            oSay:SetAlign( 1 )
        @ nRowPaint, nColumn+105 GET &oGetName VAR cGetVar OF oFld:aDialogs[ 2 ] SIZE 200, 20
            &oGetName:bChanged := CreateBlock( oGetName )
        nRowPaint := nRowPaint - 25
    NEXT


*************************************************

FUNCTION CreateBlock( cName )

RETURN { || RK_ChangeGegevenSelect( cName ) }


*************************************************

FUNCTION RK_ChangeGegevenSelect(cName)

LOCAL nGegeven := VAL(SUBSTR(cName, 11))
MsgInfo(cName)
aGegevenTekst[nGegeven,2] := cName:GetText

RETURN


Greetings,

René
Kind regards,



René Koot
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: several get's in a loop
Posted: Thu Nov 24, 2016 10:34 AM

René,

AEval( oDlg:aControls, { | oControl | If( Upper( oControl:ClassName() ) == "TGET", save oControl:GetText(), nil ) } )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 166
Joined: Wed Nov 25, 2015 07:13 PM
Re: several get's in a loop
Posted: Thu Nov 24, 2016 07:32 PM
Hello Antonio,

As I understand all defined classes are in an array. But how looks this array, is there an example anywhere?
If I ask:
oFld:aDialogs[2]:aControls[n]:ClassName()
, I get all classnames, but how to retrieve the name of the class (Like oGet1, oGet2...)

Rene
Kind regards,



René Koot
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: several get's in a loop
Posted: Thu Nov 24, 2016 10:22 PM

René,

> I get all classnames, but how to retrieve the name of the class (Like oGet1, oGet2...)

If you mean the name of the object:

oControl:cVarName

if you mean its class name:

oControl:ClassName()

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion