3

I'm working with LexisNexis VisualFiles, whose scripting language doesn't allow for descriptive variable names - all it allows is "temporary fields" and "local fields" named TF01, TF02 or LF01, LF02 etc. Other data comes from "entities" so the descriptive name of any entity is "selectedentity.EN01" for instance.

This is horribly difficult to maintain, especially as a lot of what I'm editing wasn't commented when it was written. Particularly, if I find I need to use a new variable after writing a block of code, I find I'm just trying to invent variable numbers that I'm reasonably certain haven't been used anywhere else. Does anyone have any suggestions as to how to make code like this readable and maintainable, short of commenting each and every single line manually?

Edit: This is not ECL, this is the scripting language for Visualfiles. There are no resources I can find online, my only reference is the Help file that comes with the software. This is the sort of code I'm trying to decipher:

[&Assign LF12=""]
[&Assign LF13=""]
[&Assign LF10=ARAN_AAFOO.en02]
[&Assign LF11=ARAN_AAFOO.EN56]
[&Assign LF12=ARAN_AAFOO.ABAR_ARAN.DET03]
[&Assign LF13=ARAN_AAFOO.ABAR_ARAN.DET02]
[&If LF12<> "This" &And LF12 <> "That"]
    [&If LF13=""]
      [&Assign LF13="Something"]
    [&Else]
      [&Assign LF13=LF13]
    [&EndIf]
    [&If DET12="Yes"] **priority
      [&Assign LF35="Top"]
      [&Assign LF36="abnormal"]
    [&Else]
      [&Assign LF35="Bottom"]
      [&Assign LF36="normal"]
    [&EndIf]  

Any variable can be any type, so I'm looking for a system that will help me keep organised and keep track of what I'm writing - if "comment everything" is the only solution that's fine too.

  • You seem to talk about [ECL](https://en.wikipedia.org/wiki/ECL_%28data-centric_programming_language%29) - do you have a link at hand to some description of the syntax of this scripting language? – Wolf May 08 '15 at 08:19

2 Answers2

0

Unfortunately there isn't an easy way with this. Maybe initialise the LF Fields at the top of the script with a comment next to each LF as to what it relates to. It's worth remembering that LF fields are Local to that script\document only and TF are for the duration of the session i.e. will go between scripts. It's worth trying to use LF fields where possible. You can also right click on a field, such as the DET12 one on your example and it will give you the field label.

It's all pretty messy and without prior knowledge of the DB fields and good commenting it can be a nightmare to maintain someone else's work.

KT79
  • 89
  • 1
  • 2
  • 10
  • I've decided that the sensible way to do it is to write the code with descriptive variable names so it's easy to work with, and then assign LF numbers to each variable in a section at the top of each file. That way I can do a search and replace on each variable, translating the script to and from human-friendly form when there needs to be work done on it. Getting field labels by right-click is very helpful, thanks for that. – Matte Black Sep 14 '15 at 08:02
0

You could always use declared variables. Search for &DECLARE in the 'Help'. Here's an example they give [&Declare CurrentVATRate = "17.5"]

Community
  • 1
  • 1
neilw
  • 1