help for a value

help for a value

Postby Silvio.Falconi » Fri Jan 26, 2018 12:41 pm

I must show ten images
each image name is img_name := "Image_" + hb_ntos( i )
If call myfunction() the value of nvalue is the same why ?

count:= 10
nvalue:= 0
col:= 10

nRow:= 10

For i := 1 TO count
img_name := "Image_" + hb_ntos( i )
@ nRow, Col IMAGE &img_name SIZE 12, 12 OF oDlg FILENAME Empty_Img PIXEL NOBORDER ;
ON CLICK (nvalue := Val( SubStr( img_name, RAt( '_', img_name ) + 1 ) ), myfunction())

&img_name:lTransparent := .T.

&img_name:bMMoved :={ || (nvalue := Val( SubStr( img_name, RAt( '_', img_name ) + 1 ) ), myfunction() ) }

&img_name:bMLeave :={ || (nvalue := Val( SubStr( img_name, RAt( '_', img_name ) + 1 ) ), myfunction()) }

Col += 12
Next

return nil

Function myfunction()
msginfo(nvalue)
return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6757
Joined: Thu Oct 18, 2012 7:17 pm

Re: help for a value

Postby Marc Venken » Fri Jan 26, 2018 1:18 pm

Silvio,

Should nValue not be set as a Public variable ?

Now it is local and the changes never go to the function, because you don't pass it when you call the function.

Marc
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1342
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: help for a value

Postby Silvio.Falconi » Sat Jan 27, 2018 8:59 am

it can be static
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6757
Joined: Thu Oct 18, 2012 7:17 pm

Re: help for a value

Postby Otto » Sat Jan 27, 2018 12:03 pm

Silvio,
in such situations I use detached locals.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6003
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 12 guests