Re: Dynamic Method Creation & Content Changing

2017-04-25 Thread truegold via 4D_Tech
Hi All, So after a little reading of the docs and starting at the very first example (which initially seemed incomplete) and baby stepping with simple tests... I was able to auto create and update methods on the fly using "Method Get Code/Method Set Code” So I have been able to move from a com

Re: Dynamic Method Creation & Content Changing

2017-04-23 Thread truegold via 4D_Tech
Hi Nigel, OK, thanks. I’ll see if I can figure it out. Appreciate, John... > You should not really have much trouble with 4D SET METHOD..I Use it all the > time(in development not in a live enviroment) > > METHOD SET CODE($_t_methodName;$_t_MethodText) > > just need to make sure method is n

Re: Dynamic Method Creation & Content Changing

2017-04-22 Thread Nigel Greenlee via 4D_Tech
John You should not really have much trouble with 4D SET METHOD..I Use it all the time(in development not in a live enviroment) METHOD SET CODE($_t_methodName;$_t_MethodText) just need to make sure method is not open in the design enviroment or you will get an error Nigel > On 22 Apr 2017, a

Re: Dynamic Method Creation & Content Changing

2017-04-22 Thread truegold via 4D_Tech
Hi Nigel, I’m not sure if it would be easier to use foot runner. I do know that the strategy I worked through works pretty well. Here’s the almost final result (needs to be tested further)... The send user has a UI and supplies two pieces of data: a study name (actually an abbreviation or acro

Re: Dynamic Method Creation & Content Changing

2017-04-22 Thread Nigel Greenlee via 4D_Tech
John Its always an issue when you probably wish it was a different way but it has been written and now you have to deal with it..no budget for a proper redo..no will for it either!. I would certainly consider though using Footrunner for code you you write(I don’t use footrunner as i have my o

Re: Dynamic Method Creation & Content Changing

2017-04-21 Thread truegold via 4D_Tech
Hi Nigel, First I know the issue of using 4D List as a short cut for using a real lookup of records in a table, aka choice list, for example. I have a client who has an app (I have inherited this one as well) where there are hundreds of these and they are having the kinds of problems you mentio

Re: Dynamic Method Creation & Content Changing

2017-04-21 Thread Nigel Greenlee via 4D_Tech
John 4D lists can suck if they are being edited..I remember having trouble with a system a while back where users complained that some drop downs did not have something in that should have been there..testing showed that we had code nicely adding to the 4D list that was being used in the drop

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread truegold via 4D_Tech
Hi David, First this is an App I took over and am maintaining. The client brought this to my attention because after working in the app since the late 80’s it’s still not clear and easy to remember all the steps (even with documentation) it takes to get things to the point of usability. As I l

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread David Adams via 4D_Tech
On Fri, Apr 21, 2017 at 4:30 AM, Benedict, Tom via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Sounds like you need a Rule Engine. I presented a session on implementing a Simple Rule Engine in 4D at the 2014 > Summit. If you attended the Summit that year, you can find the Session Notes on the thumb d

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread David Adams via 4D_Tech
> Anyway, I am wondering if anyone is modifying methods on the fly by inserting > selective lines of code. Yes. > What I have in mind is selectively inserting into > case statements. > Is that possible? A method is just a block of text. The magic in the method comes from 4D's interpreter. I m

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread Charles Miller via 4D_Tech
On Thu, Apr 20, 2017 at 3:18 PM, truegold via 4D_Tech <4d_tech@lists.4d.com> wrote: > Clearly that would be obvious right? It was obvious but it was part of your original question. I try to read your questions very carefully for the nuggets Regards Chuck --

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread truegold via 4D_Tech
Hey Tom, > Sounds like you need a Rule Engine Hmmm? That is something I should look into further. Thanks for the idea, John... >> I am wondering if anyone is modifying methods on the fly by inserting >> selective lines of code. What > >> I have in mind is selectively inserting into case sta

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread truegold via 4D_Tech
Hey Kirk, we’re in 4D v15 but could go to v16 anytime really. So that’s an option. I had forgotten about foot runner but Iin this case the end user already has access to design. From my purview it just seems like it’s an automated solution waiting to happen. Thanks for the info, John... > I j

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread truegold via 4D_Tech
Hi Charles, > It does not work in compiled db. In uncompiled db why not rewrite method > and replace same, no need to go though just making the adjustments > Clearly that would be obvious right? Maybe I wasn’t clear enough. This isn’t for me it’s for an end user who makes these changes - albe

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread Benedict, Tom via 4D_Tech
Hi John, > I am wondering if anyone is modifying methods on the fly by inserting > selective lines of code. What >I have in mind is selectively inserting into case statements. >Why do I need it? Because I have have a client who needs to setup various >medical trials and routines that get g

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread Kirk Brooks via 4D_Tech
Hi John, I just posted earlier today about a method I re-write periodically via code. But I don't think it's a good idea for a production db. For what you describe if you're prior v16 I'd try using Footrunner. If you're v16+ I think you can write and execute code on the fly without needing Footrun

Re: Dynamic Method Creation & Content Changing

2017-04-20 Thread Charles Miller via 4D_Tech
On Thu, Apr 20, 2017 at 1:40 PM, truegold via 4D_Tech <4d_tech@lists.4d.com> wrote: > Read method (the one I need to insert lines into) into a text array where > each element is a single line of code or comments or just white space. The > number of elements in the array would match the number of l

Dynamic Method Creation & Content Changing

2017-04-20 Thread truegold via 4D_Tech
Hi All, I know that beginning in 4D v14 we are able to create or modify methods. Prior to that we would use API Pack (I believe). Anyway, I am wondering if anyone is modifying methods on the fly by inserting selective lines of code. What I have in mind is selectively inserting into case statem