Re: Macro question - using project methods in a macro

2018-07-06 Thread Kirk Brooks via 4D_Tech
On Fri, Jul 6, 2018 at 3:03 PM Richard Wright via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Self-modifying AI code running interpreted is better than dumb code
> running compiled. Besides, I rarely write code anymore, my AI program does
> it for me (when it’s not driving my car).
>

​Do say more...
​
-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-06 Thread Richard Wright via 4D_Tech
Self-modifying AI code running interpreted is better than dumb code running 
compiled. Besides, I rarely write code anymore, my AI program does it for me 
(when it’s not driving my car).

> Date: Fri, 6 Jul 2018 10:50:02 -0700
> From: Kirk Brooks 
> 
> Richard,
> Well you couldn't do that compiled in any event. What you could do is write
> code that runs scripts external to the compiled structure using Process
> Tags.
> 
> On Fri, Jul 6, 2018 at 9:47 AM Richard Wright via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Yeah, but how am I supposed to implement AI in 4D without self-modifying
>> code? ;-)
>>> Date: Fri, 6 Jul 2018 01:08:17 +
>>> From: Keisuke Miyako 
>>> 
>>> you want to exclude the macro method from accidentally editing itself.
> 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-06 Thread Chip Scheide via 4D_Tech
You can store the code in the data file  !!!

use an object field to store any related information (context etc)
and then pray that nothing it depends on has a name change (like a 
field or table)

:)


On Fri, 6 Jul 2018 10:50:02 -0700, Kirk Brooks via 4D_Tech wrote:
> Richard,
> Well you couldn't do that compiled in any event. What you could do is write
> code that runs scripts external to the compiled structure using Process
> Tags.
> 
> On Fri, Jul 6, 2018 at 9:47 AM Richard Wright via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Yeah, but how am I supposed to implement AI in 4D without self-modifying
>> code? ;-)
>>> Date: Fri, 6 Jul 2018 01:08:17 +
>>> From: Keisuke Miyako 
>>> 
>>> you want to exclude the macro method from accidentally editing itself.
>> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-06 Thread Kirk Brooks via 4D_Tech
Richard,
Well you couldn't do that compiled in any event. What you could do is write
code that runs scripts external to the compiled structure using Process
Tags.

On Fri, Jul 6, 2018 at 9:47 AM Richard Wright via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Yeah, but how am I supposed to implement AI in 4D without self-modifying
> code? ;-)
> > Date: Fri, 6 Jul 2018 01:08:17 +
> > From: Keisuke Miyako 
> >
> > you want to exclude the macro method from accidentally editing itself.
>

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-06 Thread Richard Wright via 4D_Tech
Yeah, but how am I supposed to implement AI in 4D without self-modifying code? 
;-)


> Date: Fri, 6 Jul 2018 01:08:17 +
> From: Keisuke Miyako 
> 
> there is no need to use the clipboard.
> 
> I don't which example you saw, but I have always used SET MACRO PARAMETER 
> since v11 (Macros v2).
> 
> One piece of advise is to protect the method called from macro by doing 
> something like
> 
> Macro_MyMethod(; />)
> 
> C_TEXT($1;$2)
> 
> $methodName:=$1
> $methodPath:=$2
> 
> If ($methodPath#Current method path)
> 
> GET MACRO PARAMETER(Full method text;$methodCode)
> 
> //do stuff
> 
> SET MACRO PARAMETER(Full method text;$adjustedMethodCode)
> 
> End if
> 
> you want to exclude the macro method from accidentally editing itself.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-06 Thread Chip Scheide via 4D_Tech

On Fri, 6 Jul 2018 07:09:39 -0700, Kirk Brooks via 4D_Tech wrote:
> Thank you John, Wayne
WOW!
help from beyond!

:)
Chip
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-06 Thread Kirk Brooks via 4D_Tech
​Miyako,
That is an excellent tip - thank you. ​

On Thu, Jul 5, 2018 at 6:09 PM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> One piece of advise is to protect the method called from macro by doing
> something like
> Macro_MyMethod( />;)
>
> C_TEXT($1;$2)
>
> $methodName:=$1
> $methodPath:=$2
>
> If ($methodPath#Current method path)
> GET MACRO PARAMETER(Full method text;$methodCode)
> //do stuff
>
> SET MACRO PARAMETER(Full method text;$adjustedMethodCode)
> End if
>
> you want to exclude the macro method from accidentally editing itself.
>

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-06 Thread Kirk Brooks via 4D_Tech
Thank you John, Wayne and Miyako. That's exactly what I'd forgotten about.

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-05 Thread Keisuke Miyako via 4D_Tech
there is no need to use the clipboard.

I don't which example you saw, but I have always used SET MACRO PARAMETER since 
v11 (Macros v2).

One piece of advise is to protect the method called from macro by doing 
something like

Macro_MyMethod(;)

C_TEXT($1;$2)

$methodName:=$1
$methodPath:=$2

If ($methodPath#Current method path)

GET MACRO PARAMETER(Full method text;$methodCode)

//do stuff

SET MACRO PARAMETER(Full method text;$adjustedMethodCode)

End if

you want to exclude the macro method from accidentally editing itself.

2018/07/06 7:08、Kirk Brooks via 4D_Tech 
<4d_tech@lists.4d.com> のメール:
I found some examples on Miyako's github where he would do something
similar but then put the result into the clipboard.



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-05 Thread Wayne Stewart via 4D_Tech
Kirk,

Download the 4D Pop source code and look at the macros component for
some examples.

Regards,

Wayne




On 6 July 2018 at 10:47, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote:
> Kirk,
>
> I think you are looking for GET MACRO PARAMETER and SET MACRO PARAMETER. In 
> the method called by your macro, that allows you to get/set the selection or 
> the entire method.
>
> John DeSoi, Ph.D.
>
>
>
>> On Jul 5, 2018, at 5:08 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>>
>> I haven't tinkered with my macros in quite a while. Today I was trying to
>> write a project method that returns some text. The idea being to run the
>> method from a macro and plug the result directly into the method being
>> edited. Here's the what I was working with:
>> > version="2"
>> in_menu="true"
>> type_ahead="true"
>> type_ahead_text="rd1">
>> resdoc_macro()
>> 
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro question - using project methods in a macro

2018-07-05 Thread John DeSoi via 4D_Tech
Kirk,

I think you are looking for GET MACRO PARAMETER and SET MACRO PARAMETER. In the 
method called by your macro, that allows you to get/set the selection or the 
entire method.

John DeSoi, Ph.D.



> On Jul 5, 2018, at 5:08 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I haven't tinkered with my macros in quite a while. Today I was trying to
> write a project method that returns some text. The idea being to run the
> method from a macro and plug the result directly into the method being
> edited. Here's the what I was working with:
>  version="2"
> in_menu="true"
> type_ahead="true"
> type_ahead_text="rd1">
> resdoc_macro()
> 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**