several get's in a loop

several get's in a loop

Postby plantenkennis » Wed Nov 23, 2016 9: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: Select all  Expand view

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
plantenkennis
 
Posts: 70
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands

Re: several get's in a loop

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 35350
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: several get's in a loop

Postby plantenkennis » Thu Nov 24, 2016 7: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
plantenkennis
 
Posts: 70
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands

Re: several get's in a loop

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 35350
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveMac / FivePhone (iPhone, iPad)

Who is online

Users browsing this forum: No registered users and 1 guest