MVP 2021 Flex727 Posted July 5, 2014 MVP 2021 Report Share Posted July 5, 2014 I ran across an interesting problem today. While I was able to figure it out and correct it fairly easily, I think it points to an underlying problem with how VisiLogic is dealing with Data Tables. Here is what happened: I have a project I was modifying for another use. In it I have a Data Table with 3 columns. Part of the project modification involved editing column 3 and adding a column 4. In another project I had already made a similar modification and had some logic to write data to the modified Data Table, so I copied the logic from the second project to the first after modifying the Data Table in the first, but the Write Row to Data Table function block reversed the last two items. I confirmed that the Data Table in both projects had the exact same name, exact same number of columns, each column had the exact same name, and each column was of the exact same data type, but no matter what I did, copying the function block inexplicably reversed the last two items (NAME and EVENT columns in the attached picture). The problem turned out to be that when I edited the Data Tables in the two different projects, I went about it very slightly differently. When I inserted a column in one of them I did "Insert Before" and in the other I did "Insert After". That had the result that Visilogic identified them internally as reversed and thus reversed the columns in the Write Row function block. There is no external indication that VisiLogic is using some other method to identify columns other than the column name, but it does. In my opinion, this is poor programming practice - if VisiLogic is going to identify the columns by something other than the assigned column name, then it needs to be indicated and that is the indicator that should be selected in the Write Row function block (labeled "Destination (Cell)". Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.