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, at 17:01, truegold via 4D_Tech <4d_tech@lists.4d.com> wrote: > > 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 acronym) and a position in a string (1-80 > positions) where the position will have a single character code. These become > part of the names of the list, list items, and methods. > > With those two pieces of data I am able to auto-generate several new 4D > lists, insert into existing 4D list, create two new methods with code > formatted correctly, and… > > I couldn’t figure out how to get the Method Set Code command working so I > used Rob’s API Create Method to create the new 4D methods. Works great!!! > > I could not get API Set Method to work. In fact it always crashes in 4D v15r2 > (Mac). So, at this time, I’ll have to > > I opted for just auto-generating the code fragments (new case dispatches with > a couple lines of code) and displaying them in three text variables. Each > text variable corresponds to the method that needs to be updated. I also auto > open the three methods so they don’t have to search for them. BTW, the user > currently has access to design and makes minor tweaks from time to time. This > won’t work in compiled but they’ve never run in compiled in over 25 years. > > Then, for each text var, they can select all and copy the code fragment and > place it into the proper routine. All they need to do is go to the bottom of > the case dispatch and add these lines there. About as simple as it gets - and > yes they could still mess up. > > If I could get Rob’s API Set Method to not crash (or understand how 4D’s > Method commands work) I might be able to fully automate it. But until... > > Anyway what used to be a nightmare of steps and rereading of the cryptic docs > (and fraught with error) has been reduced to a minute or two exercise. > > Exactly what I was after. > > Finally, creating an new study is an infrequent exercise. So they might not > revisit this for another year or more. But when they do it’s now a simple > thing. > > Appreciate, > 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 own solution internal to my code)..i >> assume you can automatically create the footrunner document and that >> probably easier to ‘patch’ sections of code and sub-calls into than putting >> into 4D itself..and you could be running a compiled solution then. > > ********************************************************************** > 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: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: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************