Learning Say/Get with Fivewin (Confusion).. Solved.

Learning Say/Get with Fivewin (Confusion).. Solved.

Postby dagiayunus » Tue Nov 25, 2014 4: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: Select all  Expand view
#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
Last edited by dagiayunus on Wed Nov 26, 2014 5:08 pm, edited 1 time in total.
Regards
Yunus

FWH 21.02
dagiayunus
 
Posts: 85
Joined: Wed Nov 19, 2014 1:04 pm


Re: Learning Say/Get with Fivewin (Confusion)

Postby dagiayunus » Tue Nov 25, 2014 9: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
dagiayunus
 
Posts: 85
Joined: Wed Nov 19, 2014 1:04 pm

Re: Learning Say/Get with Fivewin (Confusion)

Postby cnavarro » Tue Nov 25, 2014 9:57 pm

Look

Code: Select all  Expand view

#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
User avatar
cnavarro
 
Posts: 6520
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Learning Say/Get with Fivewin (Confusion)

Postby Gale FORd » 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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Learning Say/Get with Fivewin (Confusion)

Postby ShumingWang » Wed Nov 26, 2014 2: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
ShumingWang
 
Posts: 461
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: Learning Say/Get with Fivewin (Confusion)

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

Re: Learning Say/Get with Fivewin (Confusion)... Solved

Postby dagiayunus » Wed Nov 26, 2014 4:41 pm

Dear Guru / Teachers

Thanks a lot. It is working now.

Regards
Regards
Yunus

FWH 21.02
dagiayunus
 
Posts: 85
Joined: Wed Nov 19, 2014 1:04 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests