Hi
So this one is for the deep divers. I am working on a project whilst all my
other projects are a bit on hold, that has been a background task for me for a
while. I won't bore everyone with WHY I am doing this, but i suspect this same
information is applicable to other developers as I have seen posts on the
subject.
As some of you know you can delve into the 4D resources and extract some
information about 4D Commands and there parameters. There are are actually two
relevant files. One is the 4DSyntax.xlf on the (en.)lproj folder and the other
is gram.4dSyntax in the resources folder. The later one i found rather
unhelfpul for my purposes as the ‘paramters’ are described by letters and the
same letters can mean different things. The xlf is nicer stuctured for me-and
someone has posted a nice parser on the forums that will read the document
which always saves work(thank you-Maurice Inzirillo i think).
So where i am is that in the absence of 4D producing something which defines
that data types for each command i am proposing producing a JSON file(for
English commands), and wondered if this is of interest to anyone else.
if it is i would be happy to discuss the formatting(maybe it should have the
command number as well as the name to make translation to other languages
easier) . Maybe other people have better ideas on how to encapsulate a few
oddifties(repeating parameters 2..n, Optional parameters), better ways to
describe a parameter that is a table or a field or a variable or a *. at the
moment the Json looks something like this(just a short extract), a shared
concept would probably be better than me inventing a wheel that only suits me,
and by having others involved it would mean we could section up the document
for validation to ensure it does not have mistakes. At the moment it includes
handling for the latest V18 command parameters although i have been extracting
using V17(and i am not currently extracting the 4D write pro commands) This is
of limited use to most programmers but for some of us this data helps us create
better code validation tools(if anyone really wants to know what i am doing let
me know and if it interests you, you will be welcome to try it out)
{
"Command Name": "collection.combine",
"Command Parameters": [
"col2",
"index"
],
"Parameter Data Types_1": [
42
],
"Parameter Flags_1": [
"Mandatory"
],
"Parameter Data Types_2": [
6,
9
],
"Parameter Flags_2": [
"Optional",
"Optional"
]
}
Any interest?..before humanity dies out.(hell... most us must be ‘at risk’).
Also..whilst i am at..anyone written anything reliable they would like to share
that gets the constants used by plug ins..there are different formats in
different plug ins and i would like to get the constants list similar to how i
get them for the 4D code.
Nigel Greenlee
**
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4d_tech-unsubscr...@lists.4d.com
**