Re: structure
- Posted by gwalters at sc.rr.com Jul 26, 2001
- 381 views
that's very neat... thanks.. ..george ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: "EUforum" <EUforum at topica.com> Subject: Re: structure > > > Also, can I suggest another way of defining your structure... > > global sequence screen > screen = { > { 1,3,"Customer Number+ ",1,1,2,0,5,0,6,0,10}, > { 10,4,"Name..: ",0,1,3,-99,40,0,0,0,20}, > { 10,5,"Addr 1: ",0,1,4,-99,25,0,0,0,30}, > { 10,6,"Addr 2: ",0,1,5,-99,25,0,0,0,40}, > { 10,7,"City..: ",0,1,6,-99,20,0,0,0,50}, > { 40,7,"State: ",0,1,7,99,2,0,0,0,60}, > { 53,7,"Zip: ",0,1,8,99,10,0,0,0,70}, > { 1,9,"Contact Nbr 1..: ",0,1,10,-99,30,0,0,0,80}, > { 1,10,"Contact Nbr 2..: ",0,1,11,-99,30,0,0,0,90}, > { 50,9,"Phone: ",0,1,9,99,17,0,0,0,100}, > { 50,10,"FAX..: ",0,1,32,99,17,0,0,0,110}, > { 50,11,"Email: ",0,1,34,-99,24,0,11,0,110}, > { 1,12,"Salesman Number: ",1,1,12,0,3,0,12,0,120}, > { 1,13,"Statements(Y/N): ",1,1,23,96,1,0,0,5,130}, > { 1,14,"Tax Auth Code..+ ",1,1,24,99,2,0,4,1,140}, > { 25,14,"Taxable: ",1,1,30,96,1,0,0,2,150}, > { 36,14,"(Y/N)",0,0,0,0,0,0,0,0,0}, > { 1,15,"Tax Id.........: ",0,1,33,99,16,0,0,0,150}, > { 1,16,"Default Shp Via+ ",1,1,42,99,2,0,7,0,190}, > { 25,16,"FOB....+ ",1,1,43,99,2,0,8,0,190}, > {1,17,"Customer Group.: ",0,1,26,99,2,0,0,0,160}, > {1,18,"Cust Price Lvl.: ",1,1,14,0,2,0,2,3,170}, > {25,18,"Prod Price Tbl: ",0,1,31,99,2,0,9,0,180}, > {1,19,"Payment Terms..+ ",1,1,29,99,2,0,5,0,190}, > {1,20,"Credit Limit...: ",0,1,27,2,10,0,0,0,200}, > {1,21,"Fin Chg (Y/N)..: ",1,1,25,96,1,0,0,4,210}, > {25,21,"Bill-to Cust #: ",0,1,13,0,5,0,3,0,220}, > {1,22,"Elec. Invoice..: ",0,1,35,99,1,0,10,0,220}, > {21,22,"(N,E,F)",0,0,0,0,0,0,0,0,0}, > {50,12,"Last Invoice Dt.: ",0,1,15,98,8,1,0,0,230}, > {50,13,"Last Invoice Amt: ",0,1,16,2,9,1,0,0,240}, > {50,14,"Last Payment Dt.: ",0,1,17,98,8,1,0,0,250}, > {50,15,"Last Payment Amt: ",0,1,18,2,9,1,0,0,260}, > {50,17,"Avg Days to Pay.: ",0,1,21,0,4,1,0,0,270}, > {50,18,"Invoices Paid...: ",0,1,20,0,4,1,0,0,280}, > {50,19,"Current Balance.: ",0,1,22,2,9,1,0,0,290}, > {50,20,"YTD Sales.......: ",0,1,19,2,9,1,0,0,300}, > {50,21,"Last Year Sales.: ",0,1,28,2,9,1,0,0,310}, > {50,22,"Date Cust Added.: ",0,1,38,98,8,0,1,0,310}, > {99,0,"",0,0,0,0,0,0,0,0,0} > } > > this is probably faster than all those append statements. > > ----- Original Message ----- > From: <gwalters at sc.rr.com> > To: "EUforum" <EUforum at topica.com> > Sent: Friday, July 27, 2001 12:29 AM > Subject: Re: structure > > > > > > > > > interesting...i'll think on it some.. > > > > ..george > > > > ----- Original Message ----- > > From: <irvm at ellijay.com> > > To: "EUforum" <EUforum at topica.com> > > Sent: Thursday, July 26, 2001 10:21 AM > > Subject: Re: structure > > > > > > > > > > > > > On Thursday 26 July 2001 09:35, gwalters at sc.rr.com wrote: > > > > > > > irv, you've hit it. each one can have a different length...problem is > > fixed > > > > now..thanks all for your input.. > > > > > > That, of course, is one of Euphoria's advantages - you can pack > > > pretty much anything you want into a sequence, without any arbitrary > > > limits or having to pre-define the space. > > > > > > As an example, the 'normal' way to implement an A/R system is with > > > two files: a customer file containing name, addr, balances, etc. > > > and a transaction file, with current txns. > > > > > > With Euphoria, I tend to use just one file, which contains: > > > (hope my indentation makes it thru EuForum intact) > > > > > > customer key > > > -- customer info > > > -- name > > > -- addr > > > -- balances > > > -- current > > > -- 30 > > > -- 60 > > > -- 90 > > > -- customer txns (zero or more) > > > -- inv # > > > -- date > > > -- amt... > > > > > > As customer makes purchases, the new purchase is just appended to > > > his/her txns sequence. > > > > > > Number of transactions can be obtained by calling length(customer[txns]) > > > Customer totals are computed by looping 1... length(txns), etc. > > > > > > This eliminates a lot of lookups and searching, since everything related > > > is located within the one file. It also simplifies things such as > deleting > > > a customer account: > > > if length(txns) > 0 > > > or balance != 0 then > > > error("Can't delete active account!") > > > > > > Backups are simple - one file to copy, as are statements. > > > Reviewing a customer's account is verrry quick, as well. > > > > > > EOM reports are less quick, because you have to loop thru all > > > customers and consolidate the data. Usually you're printing these > > > reports, so there's plenty of time for processing while the printer > > > chugs along. > > > > > > Starting a new period is just a matter of adjusting the 30/60/90, > > > and then setting customer[x][txns] = {} > > > > > > You could keep the entire sequence of customers 'in-memory', > > > but it's better to store these in a EDS database, since EDS will > > > handle the lookup logic for you and ensure the use of unique keys > > > automatically. > > > > > > Regards, > > > Irv > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >