FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Learning Say/Get with Fivewin (Confusion).. Solved.
Posts: 85
Joined: Wed Nov 19, 2014 01:04 PM
Learning Say/Get with Fivewin (Confusion).. Solved.
Posted: Tue Nov 25, 2014 04:31 PM
Dear Mr. Antonio
Many many happy returns of the day.

1. Learning Say/Get with Fivewin

When using array to get input, next get is also showing same value as first get.

Code (fw): Select all Collapse
#include "fivewin.ch"
function main()

DEFINE DIALOG oDlg FROM 1, 1 TO 40, 100 TITLE "Get Test with Array"
cCODE:=ARRAY(10)
afill(cCODE,space(30))
N:=0
for i=10 to 100 step 15
   n:=n+1
   @ i,5 say n PIXEL of oDlg
   @ i,10 get cCODE[n] PIXEL of oDlg  
next i

ACTIVATE DIALOG oDlg 
return .t.


Regards.
Yunus
Regards

Yunus



FWH 21.02
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Learning Say/Get with Fivewin (Confusion)
Posted: Tue Nov 25, 2014 05:22 PM
Posts: 85
Joined: Wed Nov 19, 2014 01:04 PM
Re: Learning Say/Get with Fivewin (Confusion)
Posted: Tue Nov 25, 2014 09:15 PM

I dont understand by deattached local (translated with google). can you apply the solution to my sample code ?

Thanks & Regards
Yunus.

Regards

Yunus



FWH 21.02
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Learning Say/Get with Fivewin (Confusion)
Posted: Tue Nov 25, 2014 09:57 PM
Look

Code (fw): Select all Collapse
#include "fivewin.ch"

function main()
Local aCode
Local aGets
Local oDlg
Local n
Local i

DEFINE DIALOG oDlg FROM 1, 1 TO 40, 100 TITLE "Get Test with Array"
aCODE:=ARRAY(10)
aGets:=Array(10)
afill(aCODE,space(30))
n:=0
for i=10 to 100 step 15
   n:=n+1
   @ i,5 say n PIXEL of oDlg
   //@ i,10 get cCODE[n] PIXEL of oDlg  
   aGets[n] := TGet():New( i, 10, MiSetGet( aCode, n ), oDlg, 70, 15, , ,;
                                 ,,,,, .T.,,,,,,,,,,,,,,,,,,, )
   aGets[n]:bValid := { || .T. }    // Por ejemplo
next i

ACTIVATE DIALOG oDlg 

return .t.

//------------------------------------------------------------------------------

Function MiSetGet( aBuffer , n )
Return bSETGET( aBuffer[ n ] )

//------------------------------------------------------------------------------
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Learning Say/Get with Fivewin (Confusion)
Posted: Tue Nov 25, 2014 10:29 PM

Others gave you the code. The problem is that when the window gets activated the array variable is settled with the current value. While it is being created is seems like the value is updated on every for/next but it is only when the activate is performed that the window manages the get variables. So you have to separate the variable from the for/next loop so that it becomes a constant value that you intended at the time of creation.

I hope i did not make it more confusing.

Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: Learning Say/Get with Fivewin (Confusion)
Posted: Wed Nov 26, 2014 02:56 AM

move
@ i,5 say n PIXEL of oDlg
@ i,10 get cCODE[n] PIXEL of oDlg

into a new funtion

Shuming wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Learning Say/Get with Fivewin (Confusion)
Posted: Wed Nov 26, 2014 11:48 AM

Yunus,

Is it clear it for you now ? Is it working already as expected ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 85
Joined: Wed Nov 19, 2014 01:04 PM
Re: Learning Say/Get with Fivewin (Confusion)... Solved
Posted: Wed Nov 26, 2014 04:41 PM

Dear Guru / Teachers

Thanks a lot. It is working now.

Regards

Regards

Yunus



FWH 21.02

Continue the discussion