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 mentioned.  I am slowly replacing 
them with table based choice list lookups.

But after reading your thoughts I realize that in this case I am not really 
doing anything dynamically EXCEPT when things need to be setup for a new study. 
And in this case without rewriting the application it must be handled the way I 
have described. So keep in mind that I have not been tasked to rewrite the App 
but only help them make this aspect of it easier.

SO the dynamic is really a one time thing. What I am really trying do is 
automate it and reduce the chances for error and not have to go through obscure 
notes to figure it out.

There are several NEW 4D lists that must be created each time they create a new 
study. Then these list need to referenced and part of the mechanism is by 
adding the names of these list to another meta list. That’s where the insert 
list items comes in.

Then there are two new methods created each time that use these NEW list. An 
the list names and number are the only thing that changes inside of this 
wrapper method that calls another method with these list names as parameters.

Outside of header and some variable declarations there is a single line of code 
which is the method and parameter list. Not much to validate here.

As to writing code inside another method that’s trickier. I might just open the 
methods and present the code lines for them to copy them in.

It’s not as bad as you think (or else I am a bit delusional! Sometimes it’s 
hard to tell. <smile>) and on the surface it seems quite easy.

I’ll be explaining it to the client today and see what they think. If they say 
go for it then I’ll give it a try and see if I can get most of it automated.

I hope that explains it better. Always hard to explain when you’re trying not 
to be verbose.

Appreciate,
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 down..lots of 
> head scratching..probably a blame fest..then we worked out what was going 
> to..the list we being written to by other clients overwriting the list. and 
> the user had a list different to what they expected.
> 
> In General I avoid using a 4D list for anything dynamic…a table with  
> something like…
> OWNER(User)<-create one ‘system’ owned list for each list name and where no 
> user specific version use the system version…(Duplicate records or combine 
> system owned with private owned)
> LIST_NAME
> LIST_ITEM_NAME
> NAME_ABBREV
> STUDY_REF 
> ..(and a record ID)
> Would be probably be a better way to handle a dynamic list and easier to then 
> relate something like study steps ..step items…step item options..etc
> 
> In my humble you should never need to have code edit itself for this kind of 
> purpose. The code should support and be supported by the data and switches in 
> the data should define the route through the code…that will always be more 
> robust and easier to write than code that writes code. 
> 
> Code that writes code is hard to validate:)..i know this ..lets say in your 
> code you have a line $_t_InsertStatement:=“IF(<>MyBadlyNamedVariable)” 1stly 
> you have to be sure that variable exists. and then if someone decides 
> somewhere to change the name of the variable it wont automatically change in 
> your hardcoded insert line and somewhere you will be getting calls about an 
> error..even worse is when 4D changes the name of the a function call or the 
> parameters.
> 
> Just my tuppence worth.

**********************************************************************
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
**********************************************************************

Reply via email to