PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Basic questions on hfdb
Basic questions on hfdb
Débuté par Basic, 25 mai 2015 01:06 - 4 réponses
Posté le 25 mai 2015 - 01:06
lets say custumer is a data fille with as keys name / adres / group is a duplicate key al keys have text mask.the data fille is filled with the records from below.

---------------------------------------------
name< / >adres< / >group<
Alden< / > ? < / > A <
Taavi < / > ? < / > B <
Nairi < / > ? < / > B <
Denzel< / > ? < / > A <

____________________________

lets say i want to display al custumers of group A (in a info popup) how can i do that? i know the functions hreadseekfirst / Hreadnext surely there must be a easy command that shows all records of 1 key ..... Or can i puth Hreadnext...in some sort of loop?if so can you give me a simpel exampe?are there some english youtube turtorials that explain most common functions related handeling data filles with windev?
Posté le 25 mai 2015 - 01:17
Hello Basic

Let's say you do some of the basic examples that come with Windev, create a basic window with a table and some basic code and then come back to us if that doesn't work

Regards
Al
Posté le 25 mai 2015 - 01:29
I can fill a table buth that proces is automated....it is not realy fair to compare both...Besides
the windev tutorial could be a lot better with more exampels building up from basic..i. wright now it is just to littel....most online video tutorials are in French and so ......bydeway did you think i didint turn to the tutorial first before posting???
Posté le 25 mai 2015 - 02:03
Hello Basic

You can set a filter on a file an dthen direct fill a table with the results by binding the table to the file, or you can run a query and the use filetotable or you can use Hreadseek() in a do while loop

Tyr the CRM example or try running the RAD in procedural code. It will build an entry screen and a view table. The code example is not that bad

Regards
Al
Posté le 25 mai 2015 - 13:22
Hi Basic,

If I where you I would study query as the source of data, and a Equals Parameter on "Group" (and perhaps a contains parameter on Name)

Nice feature of query parameters is that: "If you not set the parameter, it is not taken into account."

In this way you have a query that can sort on a group, and if the pName parameters is set, you get the a customer within that group that matches your pName criteria
.
And if you use only the pName parameter you have a search on customers name.

So one query can have multiple uses in your code.

Your code would then look something like:
//Defined parameter in the query with the query builder Qry_Customers.pGroup = "A" if hexecutequery(qry_Customers,hdefault) = True For each Qry_Customers //Do something with the data - fill a combo / Popup etc. Trace(qry_customers.name,qry_customers.group) End else Error("Something went wrong, got error.: "+herrorinfo()) end
With queryes you can display the retrived data before you write a single line of code ;)

Cheers
Tor-Bjarne