|
From: Alain A. <ala...@wa...> - 2016-07-29 15:12:33
|
Sorry, the sender was wrong.
Don't answer to in...@ga...
Thanks
--------------------------------------------------------------------
Hi,
Here is a simplificated code :
// ================================================================
function Generip()
// ================================================================
@ 10,42 SAY cText03 SIZE 200, 22 COLOR hwg_VColor("FF0000")
@ 60,40 GET COMBOBOX oRegion VAR cRegion ITEMS aRegions STYLE
WS_TABSTOP SIZE 220, 25;
ON CHANGE
{||SearchDepartment(trim(cRegion)),oDepartement:Refresh()} TEXT
@ 290,42 SAY cText04 SIZE 100, 22 COLOR hwg_VColor("FF0000")
@ 390,40 GET COMBOBOX oDepartement VAR cDepart ITEMS aDepartment STYLE
WS_TABSTOP SIZE 210, 25;
ON CHANGE {||SearchVille(trim(cDepart)), ;
qout(len(aVilles)), ;
oVille:Refresh()} TEXT
@ 290,74 SAY cText05 SIZE 100, 22 COLOR hwg_VColor("FF0000")
@ 390,72 GET COMBOBOX oVille VAR cVille ITEMS aVilles STYLE WS_TABSTOP
SIZE 210, 25 TEXT
...
// ================================================================
function SearchVille(cDepart)
// ================================================================
local rg
asize(aVilles,0)
for rg=1 to len(aDepartment)
if aDepartment[rg,1] == cDepart
codep=aDepartment[rg,2]
qout(aDepartment[rg,1])
qout(aDepartment[rg,2])
qout(aDepartment[rg,3])
if aDepartment[rg,3] == "1"
select _&codep
aadd(aVilles,"")
go top
do while .not.eof()
aadd(aVilles,trim(_&codep -> commune))
skip
enddo
asort(aVilles,,,{| x, y | Upper( x ) < Upper( y ) })
endif
exit
endif
next
qout(len(aVilles))
return nil
// ================================================================
Here are the qout()
Alsace aregions[1]
Bas-Rhin aDepartment[1,1]
67 aDepartment[1,2]
0 aDepartment[1,3] (=I
have not the list of the cities of the department)
0 len(aVilles) before
returning from SearchVille (ok!!!)
0 len(aVilles) tested
before oVilles:Refresh
Aquitaine aregions[2]
Dordogne aDepartment[1,1]
24 aDepartment[1,2]
1 aDepartment[1,3] (=I
have the list of the cities of the department)
576 len(aVilles) before
returning from SearchVille (ok!!!)
576 len(aVilles) tested
before oVilles:Refresh (ok!!!)
Aquitaine aregions[2]
Gironde aDepartment[2,1]
33 aDepartment[2,2]
0 aDepartment[2,3] (=I
have not the list of the cities of the department)
0 len(aVilles) before
returning from SearchVille (ok!!!)
0 len(aVilles) tested
before oVilles:Refresh (ok!!!)
All is ok concerning values, but when I browse in oVilles, I saw all the
cities of aVilles, even the len of aVilles is now 0
It seems that oVilles:Refresh isn't done
When I leave Generip() and open it again, oVilles is ok, without cities
I have made a last test. In the same region, changing for a department
where I have cities, refresh is ok, but I don't think it's normal.
So I can say that if oVilles is zero length, no refresh.
Can you explain where I fail, or confirm it's a bug ?
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)
------------------------------------------------------------------------
|