Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #6143 > unrolled thread
| Started by | Krystian <softb@softb.pl> |
|---|---|
| First post | 2013-10-23 04:49 -0700 |
| Last post | 2013-10-23 09:30 -0400 |
| Articles | 8 — 4 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
IVarPut Krystian <softb@softb.pl> - 2013-10-23 04:49 -0700
Re: IVarPut "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-10-23 13:54 +0200
Re: IVarPut Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2013-10-23 13:11 +0100
Re: IVarPut Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2013-10-23 15:54 +0100
Re: IVarPut Krystian <softb@softb.pl> - 2013-10-23 06:24 -0700
Re: IVarPut "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-10-23 15:44 +0200
Re: IVarPut "Jamal" <jamal@examples.net> - 2013-10-23 09:29 -0400
Re: IVarPut "Jamal" <jamal@examples.net> - 2013-10-23 09:30 -0400
| From | Krystian <softb@softb.pl> |
|---|---|
| Date | 2013-10-23 04:49 -0700 |
| Subject | IVarPut |
| Message-ID | <c6ececa1-52c2-461c-9e29-9d990043f504@googlegroups.com> |
Hallo, I have several variables on a form : var_l, var_2,,, var_n created as SLE How may I initialize this one in a loop ? for i := 1 to n ?funcput?(self, #'var+i', something) next When I use IVarPut : IVarPut(self, #odcNazwa1, 'abcd'), I receive an error message : function => object argument : 70 type string requested type : object Where is the mistake ? Thank you for any help Krystian
[toc] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-10-23 13:54 +0200 |
| Message-ID | <bcprogF2oohU1@mid.individual.net> |
| In reply to | #6143 |
Hi Krystian, > When I use IVarPut : IVarPut(self, #odcNazwa1, 'abcd'), I receive an > error message : function => object > argument : 70 > type string > requested type : object > > Where is the mistake ? oDCNazhwa1 is a protect variable of your window class, and IVarPut does not work with protect or hidden variables as they are not available from outside the class. Try do use the aControl array of the Window class. Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | Malcolm G <malcolm-news2012delete@delete.jobstream.com> |
|---|---|
| Date | 2013-10-23 13:11 +0100 |
| Message-ID | <u1P9u.16475$IK4.7823@fx35.am4> |
| In reply to | #6143 |
On 23/10/2013 12:49, Krystian wrote: > Hallo, > > I have several variables on a form : var_l, var_2,,, var_n created as SLE > How may I initialize this one in a loop ? > for i := 1 to n > ?funcput?(self, #'var+i', something) > next > When I use IVarPut : IVarPut(self, #odcNazwa1, 'abcd'), I receive an error message : > function => object > argument : 70 > type string > requested type : object > > Where is the mistake ? What is the complete code? The error says odcNazwa1 needs an object and you gave it a string, what is the type of odcNazwa1 e.g. export odcNazwa1 as OBJECT or export odcNazwa1 as SingleLineEdit would correctly give the above error
[toc] | [prev] | [next] | [standalone]
| From | Malcolm G <malcolm-news2012delete@delete.jobstream.com> |
|---|---|
| Date | 2013-10-23 15:54 +0100 |
| Message-ID | <KqR9u.21621$iD7.6056@fx22.am4> |
| In reply to | #6145 |
On 23/10/2013 13:11, Malcolm G wrote: > On 23/10/2013 12:49, Krystian wrote: >> Hallo, >> >> I have several variables on a form : var_l, var_2,,, var_n created as SLE >> How may I initialize this one in a loop ? >> for i := 1 to n >> ?funcput?(self, #'var+i', something) >> next > >> When I use IVarPut : IVarPut(self, #odcNazwa1, 'abcd'), I receive an error message : >> function => object >> argument : 70 >> type string >> requested type : object >> >> Where is the mistake ? > > What is the complete code? > > The error says odcNazwa1 needs an object and you gave it a string, > what is the type of odcNazwa1 > > e.g. > > export odcNazwa1 as OBJECT > or > export odcNazwa1 as SingleLineEdit > > would correctly give the above error At a guess you are trying to set the value of the control to a string rather than replace the control object itself with a string?
[toc] | [prev] | [next] | [standalone]
| From | Krystian <softb@softb.pl> |
|---|---|
| Date | 2013-10-23 06:24 -0700 |
| Message-ID | <a153b791-68b3-460e-9a04-a95057d4d0ae@googlegroups.com> |
| In reply to | #6143 |
W dniu środa, 23 października 2013 13:49:57 UTC+2 użytkownik Krystian napisał: > Hallo, > > > > I have several variables on a form : var_l, var_2,,, var_n created as SLE > > How may I initialize this one in a loop ? > > for i := 1 to n > > ?funcput?(self, #'var+i', something) > > next > > > > When I use IVarPut : IVarPut(self, #odcNazwa1, 'abcd'), I receive an error message : > > function => object > > argument : 70 > > type string > > requested type : object > > > > Where is the mistake ? > > Thank you for any help > > > > Krystian Hi, Thank you for help; but still it is not clear for me (maybe it is also a problem with my englisch). Here is the declaration of this entity in the class EXPORT oDCNazwa1 AS SINGLELINEEDIT How can I obtain and maintain the array of controls ? Krystian
[toc] | [prev] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-10-23 15:44 +0200 |
| Message-ID | <bcq26uF44etU1@mid.individual.net> |
| In reply to | #6147 |
Hi Krystian,
> but still it is not clear for me (maybe it is also a problem with my
> englisch).
>
> Here is the declaration of this entity in the class
>
> EXPORT oDCNazwa1 AS SINGLELINEEDIT
my mistake - I have them all as exports
> How can I obtain and maintain the array of controls ?
the aControls array is maintained by the GUI classes for you.
You can find the correct control with:
local nPos as dword
local oControl as SingleLineEdit
if ( nPos := AScan( aControls, {|o| o:NameSym == #NazWa1 } ) ) > 0
oControl := aControls[nPos]
oControl:Value := "abcd"
endif
Wolfgang
--
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <jamal@examples.net> |
|---|---|
| Date | 2013-10-23 09:29 -0400 |
| Message-ID | <l48iv6$mqo$1@speranza.aioe.org> |
| In reply to | #6143 |
Hi Krystian, Change the form "Export Controls" property to "Yes", and your code should work fine. Jamal "Krystian" wrote in message news:c6ececa1-52c2-461c-9e29-9d990043f504@googlegroups.com... Hallo, I have several variables on a form : var_l, var_2,,, var_n created as SLE How may I initialize this one in a loop ? for i := 1 to n ?funcput?(self, #'var+i', something) next When I use IVarPut : IVarPut(self, #odcNazwa1, 'abcd'), I receive an error message : function => object argument : 70 type string requested type : object Where is the mistake ? Thank you for any help Krystian
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <jamal@examples.net> |
|---|---|
| Date | 2013-10-23 09:30 -0400 |
| Message-ID | <l48j1l$n75$1@speranza.aioe.org> |
| In reply to | #6143 |
Also, change No Access/Assign to Yes. This will avoid the overhead of generating accesses and assigns. Jamal "Krystian" wrote in message news:c6ececa1-52c2-461c-9e29-9d990043f504@googlegroups.com... Hallo, I have several variables on a form : var_l, var_2,,, var_n created as SLE How may I initialize this one in a loop ? for i := 1 to n ?funcput?(self, #'var+i', something) next When I use IVarPut : IVarPut(self, #odcNazwa1, 'abcd'), I receive an error message : function => object argument : 70 type string requested type : object Where is the mistake ? Thank you for any help Krystian
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web