DTPICKER in array of gets

DTPICKER in array of gets

Postby betoncu » Tue Jan 14, 2020 5:18 pm

We can use gets as loop variable as below
Code: Select all  Expand view
@ nRow,110 GET aGets[ n ] VAR aValues SUBSCRIPT n ;
         SIZE 120,28 PIXEL OF oDlg


is it possible to use dtpicker like GETs?

I mean something like this:
Code: Select all  Expand view
@ nRow,110 DTPICKER aGets[ n ] VAR aValues SUBSCRIPT n ;
         SIZE 120,28 PIXEL OF oDlg
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: DTPICKER in array of gets

Postby nageswaragunupudi » Tue Jan 14, 2020 8:34 pm

No. You can not use the loop variable. You need to create the DTPICKER in a separate function in the good old way using the concept of detached locals.
Code: Select all  Expand view

for n := 1 to Len( aValues )
   nRow += 32
   if ValType( aValues[ n ] ) == "D"
      aGets[ n ] := MakeDtPicker( oDlg, nRow, aValues, n )
   else
      @ nRow,110 GET aGets[ n ] VAR aValues SUBSCRIPT n ;
         SIZE 120,28 PIXEL OF oDlg
   endif
next n

.....

static function MakeDtPicker( oDlg, nRow, aValues, n )

   local oGet

   @ nRow,110 DTPICKER oGet VAR aValues[ n ] ;
         SIZE 120,28 PIXEL OF oDlg

return oGet
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10331
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: DTPICKER in array of gets

Postby betoncu » Wed Jan 15, 2020 10:25 am

It works. That's enough. Thanks
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano and 136 guests