Dynamic Process Variables???

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Dynamic Process Variables???

4D Tech mailing list
I just created a new database and created a method with this code:

C_POINTER($pArray;$pLongInt)
$pArray:=Get pointer("Array")
ARRAY REAL($pArray->;1)
$pArray->{1}:=7
ALERT(String($pArray->{1}))

Compiled it, and it ran without error. How long have we been able to get a pointer to an array that was never declared to the compiler and have it work?

If I use the following code compiled I get a runtime execution error as I expected:

$pLongInt:=Get pointer("LongInt")
C_LONGINT($pLongInt->)
$pLongInt->:=8
ALERT(String($pLongInt->))


Neil








--

Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dynamic Process Variables???

4D Tech mailing list
Neil,
That's pretty cool. It never would have occurred to me to use Get pointer
that way.

I've only used dynamic vars on forms. 4D's ability to handle them is pretty
good as you discovered. As far as how long we've been able to do that I
think it's v13 at least. It's been hard for a lot of us to accept this new
syntax and the seeming lack of control that comes with it.

For example being able to pass a nil pointer to LISTBOX INSERT ARRAY for
column, header and footer vars just feels wrong. But 4D accepts it and
creates the var on the fly which you can then reference and in some cases
even type.

Your second example fails because you're addressing a variable before it's
defined which doesn't actually have anything to do with dynamic vars.


On Tue, Jun 6, 2017 at 1:03 PM, Dennis, Neil via 4D_Tech <
[hidden email]> wrote:

> I just created a new database and created a method with this code:
>
> C_POINTER($pArray;$pLongInt)
> $pArray:=Get pointer("Array")
> ARRAY REAL($pArray->;1)
> $pArray->{1}:=7
> ALERT(String($pArray->{1}))
>

--
Kirk Brooks
San Francisco, CA
=======================

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Dynamic Process Variables???

4D Tech mailing list
> I've only used dynamic vars on forms.

You and I are the same in that so far the only use of dynamic variables I have done is from forms and list boxes.

I'm reluctant to use get pointer to create a process array dynamically until it is documented as being safe, however it does seem to work.

Neil





--




Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dynamic Process Variables???

4D Tech mailing list
There was a 4D summit session by Charlie Vass and someone else using this technique in v11 or v12.

Regards,

Wayne
Sent from my iPhone

On 7 Jun 2017, at 05:53, Dennis, Neil via 4D_Tech <[hidden email]> wrote:

>> I've only used dynamic vars on forms.
>
> You and I are the same in that so far the only use of dynamic variables I have done is from forms and list boxes.
>
> I'm reluctant to use get pointer to create a process array dynamically until it is documented as being safe, however it does seem to work.
>
> Neil
>
>
>
>
>
> --
>
>
>
>
> Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
>
> The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dynamic Process Variables???

4D Tech mailing list
it's worth keeping in mind that the internal design of a pointer has been updated in v15.

this is documented.

> RESOLVE POINTER now returns -1 instead of 0 in fourth parameter for pointers on variables and single dimension arrays.
> When passing a pointer on an element of a two dimensional array, the fourth parameter receives the element number of the second dimension.
>
> Get pointer command has been rewritten to interpret the specified string as a formula and analyze produced tokens. Therefore, invalid names for a variable are now rejected: Get pointer("123") used to be accepted but now produces error 77 "Bad variable name". Another consequence is that extraneous white spaces are now supported: Get pointer(" a ") was being rejected and is now accepted for "->a". Pointer on two dimensional arrays are now accepted: Get pointer( "a{1}{2}") produces ->a{1}{2}.


http://doc.4d.com/4Dv15/4D/15/Get-pointer.300-2018637.en.html



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dynamic Process Variables???

4D Tech mailing list
ftp://ftp.4d.com/ACI_TECHNICAL_NOTES/2010/MacOS/TN_2010_01-04_%28JAN%29/10-01_VariablesOnDemand.zip


Regards,

Wayne


[image: --]
Wayne Stewart
[image: http://]about.me/waynestewart
<http://about.me/waynestewart>


On 7 June 2017 at 06:25, Keisuke Miyako via 4D_Tech <[hidden email]>
wrote:

> it's worth keeping in mind that the internal design of a pointer has been
> updated in v15.
>
> this is documented.
>
> > RESOLVE POINTER now returns -1 instead of 0 in fourth parameter for
> pointers on variables and single dimension arrays.
> > When passing a pointer on an element of a two dimensional array, the
> fourth parameter receives the element number of the second dimension.
> >
> > Get pointer command has been rewritten to interpret the specified string
> as a formula and analyze produced tokens. Therefore, invalid names for a
> variable are now rejected: Get pointer("123") used to be accepted but now
> produces error 77 "Bad variable name". Another consequence is that
> extraneous white spaces are now supported: Get pointer(" a ") was being
> rejected and is now accepted for "->a". Pointer on two dimensional arrays
> are now accepted: Get pointer( "a{1}{2}") produces ->a{1}{2}.
>
>
> http://doc.4d.com/4Dv15/4D/15/Get-pointer.300-2018637.en.html
>
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
>
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Loading...