Is my table lookup file malformed?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Is my table lookup file malformed?

  • Creator
    Topic
  • #50780
    Russ Ross
    Participant

    Is there a command line script or proc already in Cloverleaf that I can run to tell me if a table lookup file is malformed?

    I’m going to give the upstream foriegn system a copy of my Cloverleaf lookup table file and they will change via an editor as they need.

    I will uplaod the Cloverleaf table lookup file from their source system when they make a change and I pick up their daily batch file.

    It would be nice to run a validate script on the table lookup file I get from them to see if it is malformed before I try to use it.

    I see the Cloverleaf GUI IDE already reports if a table lookup file is malformed when you try to load it, so somewhere buried in Cloverleaf there is logic already written to check if a table lookup file is malformed.

    I’m hoping I can have someone tell me where it is located and how to leverage it to my benifit on the back end at the command line prompt or from within a standalone TCL script.

    Also, someone in the clovertech community might have their own homegrown validate script they might already be using to check if a table lookup file is malformed that they might be will to share.

    Russ Ross
    RussRoss318@gmail.com

Viewing 2 reply threads
  • Author
    Replies
    • #67495
      Glenn Friedenreich
      Participant

      Hi Russ – You can use hcitbllookup from a tcl prompt to validate the table.

      We test our tables this way using one valid and one invalid table key value (to test the ‘default’ case).

      For example, in a table where ’19’ is a valid key value, and ‘xy’ is not, you would see:

      $ tcl                                      

      tcl>hcitbllookup w834RelCd.tbl 19          

      3                                          

      tcl>hcitbllookup w834RelCd.tbl xy          

      tcl>                                        

      If the table is malformed, you will see the “Unable to load table” error message.

      – Glenn

    • #67496
      David Barr
      Participant

      You could probably use the Tcl “catch” command to see if there was an error executing the command.  For example:

      Code:

      set result [catch {hcitbllookup w834RelCd.tbl 19} errmsg]

      Then look at the value of the “result” variable to see if there’s a problem with the table, and look in the “errmsg” variable for additional information about the error.

    • #67497
      Russ Ross
      Participant

      Glen and David:

      Thanks for taking the time to post replies that were very applicable to my situation.

      Sometimes I feel I’ve forgotten more than I know and when I saw your replies it sounded very familar.

      I looked around and sure enough we already have some TCL procs that use a catch around the tbllookup command much like you mentioned doing for hcitbllookup so that makes perfect sense.

      Russ Ross
      RussRoss318@gmail.com

Viewing 2 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10