Welcome! Log In Create A New Profile

Advanced

[WD] HFreeQuery ???

Posted by Infoss 
Infoss
[WD] HFreeQuery ???
July 08, 2021 03:07PM
Greeting

How to use HFreeQuery syntax?

If I set the next code then the job is not completed

IF HExecuteQuery (MyQuery) HEN
Tabledisplay (MyTable)
END
HFreeQuery (MyQuery)

HFreeQuery stops loading data into the table, why?

How do you use this syntax?
Argus
Re: [WD] HFreeQuery ???
July 08, 2021 04:26PM
> How do you use this syntax?

You don't... at least not in this case

From your code, I infer that the table is linked to the query...
If that is the case, then the correct way to fill the table is with a

tabledisplay(tablename,tareexecutequery)

Of course, that is necessary only to REFRESH the table (either data has changed or query parameters have changed. IF the parameters have changed, than setting the parameters HAS TO BE DONE IN the table init code. The tabledisplay will execute that code and redo the query.

Now, if you want to use hexecutequey and hfreequery, you need to put a loop between the two and load a MEMORY table by code in the loop.

as you can see, these are two completely different cases.
Infoss
Re: [WD] HFreeQuery ???
July 08, 2021 04:59PM
Hello Argus
Thank you for your reply

Yes my table is related to the query.
If I turn off hfreequery then the table loads all the syllables, however
when i put hfrequery at the end of the code then about 30 syllables are loaded and nothing else.

How do I free memory or unmount my query table and fill it as a memory table?
pao
Re: [WD] HFreeQuery ???
July 08, 2021 05:26PM
In this case (table linked to the query) you can only free the query when you close the form.
To free the query as soon as possible don't link the table tro the query all fill it by programming (memory table).

Regards

Paulo Oliveira
Re: [WD] HFreeQuery ???
July 09, 2021 10:10AM
Hi All,
it is totally legal to do this:

myquery.q1="s1"
myquery.q1="s2"
HexecuteQuery(myQuery)
tabledisplay(table_myQuery)

where the table_myQuery is "binded" to the query.
You don't have to do tabledisplay(tablename,tareexecutequery) and use the table init to change the query parameters ..
This type of code can be EVERYWHERE in the window and it gives a lot more control.

As for the use of HFreeQuery (MyQuery), just avoid it.
Many WD tasks run in the background AND NOT everything may be completed when you run HFreeQuery - even if it is the last line in the code. You must also be careful when using HCancelDeclaration


Regards
Steven Sitas
Re: [WD] HFreeQuery ???
July 12, 2021 06:49AM
Hello Steven.

What do you mean "Many WD tasks run in the background AND NOT everything may be completed when you run HFreeQuery" ?
I use HFreeQuery(...) in the close section of window only, when large results are expected like search queries with many creteria

Regards

Vassilis Boutsikas
Re: [WD] HFreeQuery ???
July 12, 2021 08:48AM
Greeting
I have a loop with several related queries and finally a union of queries, I use HFreeQuery (). I fill the table with HAddTableLine (). When the Table binds to the query then HFreeQuery () stops loading data into the table

[infosonline.net]
Re: [WD] HFreeQuery ???
July 12, 2021 09:18AM
Hi Vassilis,
this kind of code is dangerous:
! do some queries and table filling
HFreeQuery()
close(myWindow)

it should be:
! do some queries and table filling
close(myWindow)
and in the closing embed of the window:
HFreeQuery()

There are lots of places on WD where code is NOT executed in a SERIAL way - even YOUR same thread !!
The most notable one is when adding windows to a dynamic tab ..

Regards
Steven Sitas
Re: [WD] HFreeQuery ???
July 12, 2021 10:33AM
Hi Steven,

You have right!

I put the HfreeQuery in the close section of any type of Window (internal or not).

Regards

Vassilis
Re: [WD] HFreeQuery ???
July 12, 2021 11:01AM
Greeting
How to check if the loading of data into the table is completed? Maybe that would solve the problem

[infosonline.net]
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: