Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper Visual-Objects > Re: DBServer:Fi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 11326 of 11703
Post > Topic >>

Re: DBServer:FieldGet( ) / FieldPut( )

by "Stephen Quinn" <stevejqNO@[EMAIL PROTECTED] > Apr 21, 2008 at 02:38 AM

Tony

> This was a number of suggestions from an earlier question I had
> regarding warning messages being received.

That had to do with the way you instanciated the Server.
If you create teh Server in the DBEditor you can have ACCESS/ASSIGNs for 
ever field in the DBF automatically created for you (you can also turn
this 
off - recommended <g>).
Creating them automatically is in *most* cases is overhead you don't need
in 
the app. (especially if you have a lot of Servers)
So when you do
    oCustomer := CUSTOMER{} // Server was created in the DBEditor
    oCustomer:LastName := 'Jones'   // OK no-error assign has been creted
in 
the DBEditor
 but when you
    oCustomer := DBServer{ 'CUSTOMER.DBF' }
here are no ACCESS/ASSIGNs  and when you use
    oCustomer:LastName := 'Jones'  // ERROR no assign for LastName.

Using FIELDPUT/FIELDGET willl work in both instances of the Server
    oCustomer:FIELDPUT( #LASTNAME, 'Jones' )

We turn off auto-generation of ACCESS/ASSIGNs and write more meaningful
ones 
as required into each Server we create.
Eg
    oProperty:IsHoliday    // Holiday property
    oTenant:IsInArrears    // Is this Tenant in arrears
    oOwner:PropertyCount  // How many properties does this Owner have

> Does it matter if we go straight to a fieldput, or is this poor coding?
No and No.
ACCESS/ASSIGNs have a use but you pay with the extra code/overhead 
(especially if you auto-generate them in the Servers)

NOTE: The above has nothing to do with strong typing cl*****, that's a 
different discussion altogether

CYA
Steve
 




 8 Posts in Topic:
DBServer:FieldGet( ) / FieldPut( )
Tony Holland <tony.hol  2008-04-20 04:53:37 
Re: DBServer:FieldGet( ) / FieldPut( )
"Geoff Schaller"  2008-04-20 12:39:38 
Re: DBServer:FieldGet( ) / FieldPut( )
Tony Holland <tony.hol  2008-04-20 05:56:21 
Re: DBServer:FieldGet( ) / FieldPut( )
"Geoff Schaller"  2008-04-20 13:12:39 
Re: DBServer:FieldGet( ) / FieldPut( )
Tony Holland <tony.hol  2008-04-20 06:43:33 
Re: DBServer:FieldGet( ) / FieldPut( )
"Stephen Quinn"  2008-04-21 02:38:58 
Re: DBServer:FieldGet( ) / FieldPut( )
D.J.W. van Kooten <pub  2008-04-21 07:55:31 
Re: DBServer:FieldGet( ) / FieldPut( )
Tony Holland <tony.hol  2008-04-21 01:07:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 21:22:58 CDT 2008.