Page 21 of 21

Re: HMG.3.4.2

Posted: Tue May 24, 2016 12:23 pm
by jozef
Hello all,

I have some question who knows answer.

In my part of code (see bottom) I needed add command "SELECT JEDNA_A" before command DBSETFILTER because without it I got runtime error "Area not in use". I dont understand it.

Code: Select all

   use (pracadr+"jedna_a.dbf") index ex_temp alias jedna_a new
   sel_val := win_exp_dav_1A.combo_1.value
   hodnota = ex_kody_lek[sel_val] 
   if    sel_val > 1
         select jedna_a 
         dbsetfilter({|| lekar = hodnota} , "lekar = hodnota") 
   else
         dbclearfilter()
   endif
Thanks for your answers.

Jozef

Re: HMG.3.4.2

Posted: Tue May 24, 2016 12:33 pm
by mol
jozef wrote:Hello all,

I have some question who knows answer.

In my part of code (see bottom) I needed add command "SELECT JEDNA_A" before command DBSETFILTER because without it I got runtime error "Area not in use". I dont understand it.

Code: Select all

   use (pracadr+"jedna_a.dbf") index ex_temp alias jedna_a new
   sel_val := win_exp_dav_1A.combo_1.value
   hodnota = ex_kody_lek[sel_val] 
   if    sel_val > 1
         select jedna_a 
         dbsetfilter({|| lekar = hodnota} , "lekar = hodnota") 
   else
         dbclearfilter()
   endif
Thanks for your answers.

Jozef
It's strange, because workarea JEDNA_A should stay selected after USE command.
You can use this code:

Code: Select all

 if    sel_val > 1
         jedna_a->(dbsetfilter({|| lekar = hodnota} , "lekar = hodnota") )
   else
         jedna_a->(dbclearfilter())
   endif
this behaviour depends from harbour, not hmg

Re: HMG.3.4.2

Posted: Tue May 24, 2016 1:12 pm
by jozef
I found out that problem started when I put MSGBOX before command "IF" to test value of variable hodnota. Is it possible that msgbox change workarea?
Without msgbox command it is working well.
Jozef

Re: HMG.3.4.2

Posted: Fri Mar 24, 2017 11:04 pm
by Pablo César
I don't think so. Really not way.