HMG.3.4.2

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

jozef
Posts: 17
Joined: Sat Apr 02, 2016 4:53 pm
DBs Used: DBF
Location: Bratislava, Slovak Republic
Has thanked: 4 times

Re: HMG.3.4.2

Post by jozef » Tue May 24, 2016 12:23 pm

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

User avatar
mol
Posts: 2834
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 118 times
Been thanked: 63 times
Contact:

Post by mol » Tue May 24, 2016 12:33 pm

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
Last edited by mol on Tue May 24, 2016 1:55 pm, edited 1 time in total.

jozef
Posts: 17
Joined: Sat Apr 02, 2016 4:53 pm
DBs Used: DBF
Location: Bratislava, Slovak Republic
Has thanked: 4 times

Post by jozef » Tue May 24, 2016 1:12 pm

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

User avatar
Pablo César
Posts: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Fri Mar 24, 2017 11:04 pm

I don't think so. Really not way.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Post Reply