|
From: Alain A. <ala...@wa...> - 2016-07-30 19:29:21
|
Hi, here is my code:
if chaine="changer"
@ 30,60 GET CHECKBOX oDefaut VAR lDefaut CAPTION "Département
par défaut" ;
SIZE 250, 25 STYLE WS_TABSTOP ON CLICK
{||qout(lDefaut),lDefaut=noChange(cDepart,lDefaut),qout(lDefaut),oDefaut:Refresh}
endif
//
============================================================================
function IsDefault(cDepart)
//
============================================================================
local range
range=ascan(aDepartment,{| x | x[1]==cDepart})
return aDepartment[range,5]
//
============================================================================
function noChange(cDepart,lDefaut)
//
============================================================================
qout(cDepart) <<< Dordogne
if cDepart==cDefDep
lDefaut=.T.
endif
qout(lDefaut) <<< .T.
return lDefaut <<< .T.
Here is tha array :
aDepartements:={{"Ain" ,"01",text",.T.,.F.},:
. {"Aisne" ,"01",text",.T.,.F.},:
. {"Allier" ,"01",text", .T.,.F.},:
. {"Dordogne","01",text",.T.,.T.},:
. {"Gironde" ,"01",text",.T.,.F.},:
I first confirm the bug of the value which isn't updated, and I must use
a function like qout(var) to commit the change.
But my problem here is concerning noChange.
I want if aDepartements[x,5] is .T., that the value can't be changed.
In noChange(), I saw that it seems to work, but qout(lDefaut) after
noChange() in oDefaut codeblock reports .F.
Is-it really possible to do ? and how ?
Thanks
A+
--
------------------------------------------------------------------------
Alain Aupeix
http://jujuland.pagesperso-orange.fr/
http://pissobi-lacassagne.pagesperso-orange.fr/
------------------------------------------------------------------------
U.buntu 12.04 | G.ramps 3.4.9-1 | H.arbour 3.2.0dev (2016-07-18 18:32) |
Hw.Gui 2.19-6 (2543)
------------------------------------------------------------------------
|