Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #5440 > unrolled thread
| Started by | MikeScholl@btinternet.com |
|---|---|
| First post | 2013-07-03 03:09 -0700 |
| Last post | 2013-07-03 09:58 -0700 |
| Articles | 9 — 4 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
DBServer Access Method MikeScholl@btinternet.com - 2013-07-03 03:09 -0700
Re: DBServer Access Method "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-07-03 12:58 +0200
Re: DBServer Access Method Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-07-03 15:54 +0200
Re: DBServer Access Method "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-07-03 16:57 +0200
Re: DBServer Access Method Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-07-03 13:05 +0200
Re: DBServer Access Method D.J.W. van Kooten <public@ic2remove.this.com> - 2013-07-03 13:12 +0200
Re: DBServer Access Method Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-07-03 14:32 +0200
Re: DBServer Access Method D.J.W. van Kooten <public@ic2remove.this.com> - 2013-07-03 15:27 +0200
Re: DBServer Access Method MikeScholl@btinternet.com - 2013-07-03 09:58 -0700
| From | MikeScholl@btinternet.com |
|---|---|
| Date | 2013-07-03 03:09 -0700 |
| Subject | DBServer Access Method |
| Message-ID | <e7d0b548-8548-47a5-89e5-0d36f33c6719@googlegroups.com> |
I have a function that takes a string parameter which can be a fieldname or access method
I want to retrieve the field value or access value
IF !Empty(oS2) .and. oS2:FieldPos(cFld) > 0 .or. IsAccess(oS2, String2Symbol(cFld))
uValue := oS2:FieldGet(cFld) //crashes if IsAccess
ELSE
uValue := ""
ENDIF
It must be possible to execute the access but I can't think how.
I do something similar when setting up bBrowsers where I store a list of column names but bBrowser has a handy #ACCESS parameter in bDataColumn:Init
Mike
[toc] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-07-03 12:58 +0200 |
| Message-ID | <b3ieepFmd7qU1@mid.individual.net> |
| In reply to | #5440 |
Hi Mike, > I have a function that takes a string parameter which can be a > fieldname or access method I want to retrieve the field value or > access value > > IF !Empty(oS2) .and. oS2:FieldPos(cFld) > 0 .or. IsAccess(oS2, > String2Symbol(cFld)) uValue := oS2:FieldGet(cFld) //crashes if > IsAccess > ELSE > uValue := "" > ENDIF > It must be possible to execute the access but I can't think how. try this:; symField := String2Symbol( cFld ) do case case IsAccess( oS2, symField ) uValue := IVarGet( oS2, symField ) case oS2:FieldPos( symField ) > 0 uValue := oS2:FieldGet( symField ) endcase HTH Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> |
|---|---|
| Date | 2013-07-03 15:54 +0200 |
| Message-ID | <76b8t8l3j0004mjcc8f76vt9sqv90bh3i7@4ax.com> |
| In reply to | #5441 |
Wolfgang, why not: symField := String2Symbol( cFld ) do case case IsAccess( oS2, symField ) uValue := oS2: symField <--- case oS2:FieldPos( symField ) > 0 uValue := oS2:FieldGet( symField ) endcase Karl > symField := String2Symbol( cFld ) > do case > case IsAccess( oS2, symField ) > uValue := IVarGet( oS2, symField ) > case oS2:FieldPos( symField ) > 0 > uValue := oS2:FieldGet( symField ) > endcase
[toc] | [prev] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-07-03 16:57 +0200 |
| Message-ID | <b3ise9Fpdn5U1@mid.individual.net> |
| In reply to | #5447 |
Hi Karl, > why not: > symField := String2Symbol( cFld ) > do case > case IsAccess( oS2, symField ) > uValue := oS2: symField <--- if the type of oS2 is a generic dbserver, but the object is a subclass of dbserver that may contain more access variables than the original class, this would give a compile time error. I'm doing such things very, very often. Wolfgang
[toc] | [prev] | [next] | [standalone]
| From | Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> |
|---|---|
| Date | 2013-07-03 13:05 +0200 |
| Message-ID | <p518t8lp71pn0cg1lsum16n58qofeg8deb@4ax.com> |
| In reply to | #5440 |
Mike, if i get you correctly uValue := oS2:cFld should do it, at least if your server either has exports or accesses for the fieldnames. Karl >I have a function that takes a string parameter which can be a fieldname or access method >I want to retrieve the field value or access value > >IF !Empty(oS2) .and. oS2:FieldPos(cFld) > 0 .or. IsAccess(oS2, String2Symbol(cFld)) > uValue := oS2:FieldGet(cFld) //crashes if IsAccess > >ELSE > uValue := "" >ENDIF >It must be possible to execute the access but I can't think how. >I do something similar when setting up bBrowsers where I store a list of column names but bBrowser has a handy #ACCESS parameter in bDataColumn:Init > >Mike
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <public@ic2remove.this.com> |
|---|---|
| Date | 2013-07-03 13:12 +0200 |
| Message-ID | <e318t81ooegdgovv6kllbc386u9kdvvarr@4ax.com> |
| In reply to | #5440 |
On Wed, 3 Jul 2013 03:09:52 -0700 (PDT), MikeScholl@btinternet.com wrote: Hello Mike, >I have a function that takes a string parameter which can be a fieldname or access method >I want to retrieve the field value or access value I don't use any access/assigns for dbserver (I always use Fieldget(#field). I wonder why a fieldget crashes when there is an access method. It should work regardless the presence of an access I would say. Does it make a difference when you use a symbol as paramater? Otherwise you may try it with uValue:=send(os2,cFld). An access is after all a kind of method, and IsAccess() says "Check whether a particular access method can be sent to an object.", so I would say SEND may work (not tested it though..) Dick
[toc] | [prev] | [next] | [standalone]
| From | Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> |
|---|---|
| Date | 2013-07-03 14:32 +0200 |
| Message-ID | <4d68t85td0nhrqip9ilvchtsm4nhdeflh5@4ax.com> |
| In reply to | #5443 |
Dick, >Check whether a particular access method just for the record: there's no such thing. An access is equivalent to a variable, not a method.... Karl
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <public@ic2remove.this.com> |
|---|---|
| Date | 2013-07-03 15:27 +0200 |
| Message-ID | <ph98t8l9nei8kmvkia7lbml5s6j4g1mfor@4ax.com> |
| In reply to | #5444 |
On Wed, 03 Jul 2013 14:32:42 +0200, Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> wrote: Hello Karl, >just for the record: there's no such thing. An access is equivalent to >a variable, not a method.... > I think Wolfgang's iVarget is the solution, but this is what the help says about ACCESS: " Like other methods, access methods are entities;" So whoever wrote the help file seems to think an access is a method. What of course needn't mean that SEND would have worked... Dick
[toc] | [prev] | [next] | [standalone]
| From | MikeScholl@btinternet.com |
|---|---|
| Date | 2013-07-03 09:58 -0700 |
| Message-ID | <ede44c56-2715-48f2-855f-93c112ce718b@googlegroups.com> |
| In reply to | #5440 |
On Wednesday, 3 July 2013 11:09:52 UTC+1, mikes...@btinternet.com wrote: > I have a function that takes a string parameter which can be a fieldname or access method > > I want to retrieve the field value or access value > > > > IF !Empty(oS2) .and. oS2:FieldPos(cFld) > 0 .or. IsAccess(oS2, String2Symbol(cFld)) > > uValue := oS2:FieldGet(cFld) //crashes if IsAccess > > > > ELSE > > uValue := "" > > ENDIF > > It must be possible to execute the access but I can't think how. > > I do something similar when setting up bBrowsers where I store a list of column names but bBrowser has a handy #ACCESS parameter in bDataColumn:Init > > > > Mike Thanks for all the comments. Wolfgang had the solution. IvarGet works fine but both the oS: symField and Send(oS2,cFld) causes a run time error. Many thanks Mike
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web