Best technic to use the set relation to syntax

Best technic to use the set relation to syntax

Postby Marc Venken » Thu Jan 06, 2022 9:40 am

I wonder what the best technic would be in folowing senario....

Small network (4 pc) and a program with 5 folderex folders.

Asume :
Customers basic data
invoices
contactpersons
specific settings

I can set a relation from cusrtomer to each data for filtering the folders. That works.

But... At that point, when i'm in folder 1, the basic and start scrolling for a customer, or a seek every time the set relation for all folders will be updated, so slowing down the basic browse.
How do you guys do this ? Only change the querry at the moment you hit the folder tap ? and not use a relation, but more of a ordscope ?

The relations make it more easy, but slows down, as far as I know the way to program them.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Best technic to use the set relation to syntax

Postby karinha » Thu Jan 06, 2022 10:38 am

Have you tried using INDEX ON MEMORY / TEMPORARY?

If you have a little example, it gets easier.

Hugs.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7827
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Best technic to use the set relation to syntax

Postby Marc Venken » Thu Jan 06, 2022 11:02 am

Index on ...

That is a new idea for this purpose.

I'm expanding the program you and I started ))))). It starts to have potential.
I have to see how to change the code in order to make it with dbf samples from the sample dir, but I asked your mailadres (other post) so I could send the actual dbf's (or a link)

Than you can see where I'm. It will become a invoicing program based on folderex and xbrowse. For the Xbrowse I made a Xbrowse Builder that calls his data from 2 dbf files. Great working for my way of doing )))

This is the code now for callling Xbrowse. One row and all setting, positions, layouts, colors are dbf based.

// Marc, write the code here on the spot.

// FOLDER 2 -----------------------------------------------------------------------------------------------
// 2 browsers on 1 folder
oBrw[2] = getXBrowser("KLANTDOCUMENTEN",oFld:aDialogs[2])
oBrw[6] = getXBrowser("KLANTFACTART",oFld:aDialogs[2])
oBrw[2]:bChange := { || oBrw[6]:refresh() }

// FOLDER 3 -----------------------------------------------------------------------------------------------
oBrw[3] = getXBrowser("KLANTPERSONEN",oFld:aDialogs[3])

// FOLDER 4 -----------------------------------------------------------------------------------------------
oBrw[4] = getXBrowser("FACTUREN",oFld:aDialogs[4])
//StyleBrowse(oBrw[4],{ "factuur","klantnum" },{ "factuur","klantnum" })
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Best technic to use the set relation to syntax

Postby Otto » Thu Jan 06, 2022 2:11 pm

Marc, would you be so kind to post a screenshot how the program looks like?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Best technic to use the set relation to syntax

Postby Marc Venken » Fri Jan 07, 2022 9:06 pm

Otto wrote:Marc, would you be so kind to post a screenshot how the program looks like?
Best regards,
Otto


Otto,

At this moment it is just the layout like we are talking about here... I first want to have a good XbrowseBuilder with 1 line of code, than I expand to a invoices system because it will need many browsers.

viewtopic.php?f=3&t=41270

BTW : Have you a link on how to build those animated postings you guys can do in this forum ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Best technic to use the set relation to syntax

Postby James Bott » Tue Jan 11, 2022 12:14 am

Marc,

How do you guys do this? Only change the query at the moment you hit the folder tab? and not use a relation, but more of an ordscope ?


What you suggest is just not feasible speed wise.

This is what I would do. Show one browse full screen with the customer list. Have a lookup GET on the toolbar to find a specific customer. After the user finds the customer, they double-click on it in the browse. Then a dialog comes up with folders for invoices, contacts, etc.

And yes, I would find related info with scopes, not set relation.

This way the user has access to all the information you want and the program is much faster.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Best technic to use the set relation to syntax

Postby Otto » Tue Jan 11, 2022 1:22 am

Hello Mark,
I'm not sure I fully understand what you're trying to do.
I have - I think - a similar system. Here is the information in the document name.
I then read the directories into an array with Directory () and filter that array.
I don't think it's slow.
Best regards,
Otto
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=33215&p=211109&hilit=emaildesktop&sid=b3850318df4e3d5aa66ac93d1bca063c&sid=b3850318df4e3d5aa66ac93d1bca063c#p211109
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Best technic to use the set relation to syntax

Postby Marc Venken » Tue Jan 11, 2022 9:18 am

James,

I also used Ordscopes in my old version, and possible also in the new project.
It was while looking into the Yunus sample that Mr. Rao has used relations. I implemented relations in my first setup ans that is working, but a relation is changing the child database result everytime the parent is moving.
I have to say that in my old version, ordscope is olso changing the child when a move is done in the parent, because there I used the : oChange.... Ordscope syntax.

My original question is that when I don't use the Onchange in the parent, (My child browsers all always on a other foldertab. ) there is no movement while going true the parent.

At the moment I want to see the invoices, I need to click on the Invoice Tab, and THEN I schould Ordcope the data from the folderaction (getfocus) function, so when the invoice tab is shown, the data whill be the scope. Then there will be only 1 scope done.

This make sence right ? Minimal scopes are done...
Good technic ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Best technic to use the set relation to syntax

Postby James Bott » Tue Jan 11, 2022 3:56 pm

Marc,

My original question is that when I don't use the Onchange in the parent, (My child browsers all always on a other foldertab. ) there is no movement while going true the parent.


Yes, that is what you want. Otherwise you are dragging lots of useless data over the LAN each time you move from one customer to the next.

At the moment I want to see the invoices, I need to click on the Invoice Tab, and THEN I schould Ordcope the data from the folderaction (getfocus) function, so when the invoice tab is shown, the data whill be the scope. Then there will be only 1 scope done.


Yes, this will be a lot faster and will reduce the network traffic immensely.

This make sence right ? Minimal scopes are done...

Exactly.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Best technic to use the set relation to syntax

Postby Marc Venken » Tue Jan 11, 2022 4:13 pm

James,

Also my first class ever used. At this moment I try to get as much as possible systeem var's into this

I have read your papers ))

At the beginning :

Code: Select all  Expand view  RUN


oMarc:= TMarc():new()
oMarc:aLever = readleveranciers()

CLASS TMarc
   DATA  aMaanden  AS ARRAY INIT {"Jan","Feb","Mrt"}
   DATA  aDbfVelden  AS ARRAY INIT {}
   DATA  aLever AS ARRAY INIT {}
   //DATA  aLever AS ARRAY INIT readleveranciers()  // Not working
   DATA  aStates AS ARRAY INIT { { } } // state 0 defined as empty
   DATA  name INIT "Just a Name"
   METHOD NEW
ENDCLASS

METHOD NEW CLASS TMarc

   SET AUTORDER TO 1
   SET CENTURY ON
   SET DATE BRITISH
   SET TIME FORMAT TO "HH:MM:SS"
   SET EPOCH TO YEAR( DATE() ) - 30
   SET SOFTSEEK OFF
   SET WRAP ON
   SETCANCEL( .F. )
   SET CONFIRM OFF
   SET DELETED ON
   SET _3DLOOK ON
   SET UNIQUE OFF
   SET ESCAPE OFF
   SET EXACT ON
   SET EXCLUSIVE OFF
   SET MULTIPLE OFF
   SET AUTORDER TO 1
   define font oFontw name "MS Sans Serif" size 0,-50

RETURN SELF

function ReadLeveranciers() //  Just pulling some data into a array
   local aDbf  := {}
   local c, aDir
   Minfilesize:= 1
   netopen("Lever")
   DBEVAL( { || AAdd( aDbf, {FIELD->klant_nr,FIELD->naam_1,FIELD->tag} )} )
   ASORT(aDbf, , , { | x,y | x[2] < y[2] } )  //  A->Z 2 veld
   close lever

return aDbf

 


When I start the actual work for invoice making : it will become Tdatabase
For now preparing the Browsemaker, some systemtools and thinking of strategy like the post above.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Best technic to use the set relation to syntax

Postby James Bott » Tue Jan 11, 2022 6:16 pm

Marc,
When I start the actual work for invoice making : it will become Tdatabase


An invoice is a complex object, as it contains a customer, an invoice header, and invoice line Items, all of which are objects themselves. Then you add methods like oInvoice:Total() and oInvoice:PaymentDueDate(), etc.
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Best technic to use the set relation to syntax

Postby Marc Venken » Tue Jan 11, 2022 8:58 pm

Indeed,

But you posted several topics and replies on the topics of Tdatabase. We had also several samples, so it is sure possible to get a good start from it.
The nice thing is we can mostly find help in this Forum. At least, I make use of it )))

But I spend a lot of time finding out some fundamentals that I need to understand, so digging in the forum and samples is the way to go.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests