Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11282

Re: Database ACCESS/ASSIGN with function

From "Jamal" <noooospam@example.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Database ACCESS/ASSIGN with function
Date 2018-01-10 10:29 -0500
Organization albasani.net
Message-ID <p35bh0$utv$1@news.albasani.net> (permalink)
References <72d34f83-34d6-4050-9e2b-d148bbed72e9@googlegroups.com> <p3312m$tab$1@news.albasani.net> <0bf26617-e04e-49b6-9b33-f9d2216674a5@googlegroups.com>

Show all headers | View raw


If that works, go for it. The FieldGet() and FieldPut() just encapsulate the 
code within and you can have any code within to manipulate the values.

Note: you need to call SUPER methods to avoid an endless recursive loop, 
i.e. do this:

METHOD FieldPut(uField, uValue) CLASS MyNIPDBServer
IF AsSymbol(uField)==#NIP
     RETURN SUPER:FIELDPUT(uField, KodujNIP(uValue))
  ELSE
     RETURN SUPER:FIELDPUT(uField, uValue)


Jamal

"Grzegorz R."  wrote in message 
news:0bf26617-e04e-49b6-9b33-f9d2216674a5@googlegroups.com...

@Karl

W dniu wtorek, 9 stycznia 2018 17:56:27 UTC+1 użytkownik Karl Faller 
napisał:
> Grzegorz,
> did you try to set "No Access/Assign" in DB-Editor from Auto to
> "false"?
>
> Karl
>
Hi Karl - this does not help because all references to this database got 
destroyed.


@Jamal

W dniu wtorek, 9 stycznia 2018 19:19:04 UTC+1 użytkownik Jamal napisał:
> Besides the other ideas and to reduce amount of generated code and instead
> of creating assigns and accesses for all fields, I would subclass the
> dbServer class and create my own FIELDGET() and FIELDPUT() methods.
>
> For example:
>
> CLASS MyNIPDBServer INHERIT DBServer
>
> Method Init(.....) CLASS MyNIPDBServer
>     // init code
> RETURN SELF
>
> METHOD FieldGet(uField) CLASS MyNIPDBServer
>
>     RETURN DekodujNIP(SELF:FIELDGET(uField))
>
> METHOD FieldPut(uField, uValue) CLASS MyNIPDBServer
>
>     RETURN SELF:FIELDPUT(uField, KodujNIP(uValue))
>
> Jamal

Hi Jamal
this does not help because the database conatins also other fields not only 
NIP field.
My db server is already inherited (I implemented automatic db build if not 
exist and structure IDE-vs-File check).
The only chance with above is to include fieldname test like this:

METHOD FieldPut(uField, uValue) CLASS MyNIPDBServer
IF AsSymbol(uField)==#NIP
     RETURN SELF:FIELDPUT(uField, KodujNIP(uValue))
  ELSE
     RETURN SELF:FIELDPUT(uField, uValue)

What You think?

Regards
Gregory 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Database ACCESS/ASSIGN with function "Grzegorz R." <ramotny64@gmail.com> - 2018-01-09 08:01 -0800
  Re: Database ACCESS/ASSIGN with function JohnMartens <martens@tennishulp.info> - 2018-01-09 17:11 +0100
  Re: Database ACCESS/ASSIGN with function Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2018-01-09 17:56 +0100
  Re: Database ACCESS/ASSIGN with function "Jamal" <noooospam@example.com> - 2018-01-09 13:19 -0500
    Re: Database ACCESS/ASSIGN with function "Grzegorz R." <ramotny64@gmail.com> - 2018-01-09 23:23 -0800
      Re: Database ACCESS/ASSIGN with function "Jamal" <noooospam@example.com> - 2018-01-10 10:29 -0500
        Re: Database ACCESS/ASSIGN with function "Grzegorz R." <ramotny64@gmail.com> - 2018-01-21 03:25 -0800

csiph-web