GonzaloRoldan_ Posted February 25, 2019 Report Share Posted February 25, 2019 Hi people! I'm developing a project with UniLogic v1.25.61 for the UniStream USP-104-B10. I need to sort an entire Data Table (2 columns, A and B), sorting just one column (A), has anyone ever try this? The other option is to have 2 arrays (A and B), sort one (A) of them and then I need to sort the other one (B) the same way I sorted the first one (A). I don't know if I'm being clear enough so here you have an example: Before sorting: A={1,4,2,3} B={Q,W,E,R} After sorting just column A or array A: A={1,2,3,4} B={Q,E,R,W} Thanks in advance! Cheers, Gonzalo Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 26, 2019 Report Share Posted February 26, 2019 hi GonzaloRoldan_, what data type are column A and B? Link to comment Share on other sites More sharing options...
GonzaloRoldan_ Posted February 26, 2019 Author Report Share Posted February 26, 2019 Hi @ORSO2001, The data type for both columns is INT32. Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 26, 2019 Report Share Posted February 26, 2019 hi, can be the DTI sorted from the beginning or you also need to know the time order that each record was insert? how many rows are in the DTI? Link to comment Share on other sites More sharing options...
GonzaloRoldan_ Posted February 27, 2019 Author Report Share Posted February 27, 2019 Hi! Sorry for the delay, but I was working on that because I needed to solve it asap. The DTI can be sorted from the beginning. The number of rows is variable (no more than 20). I managed to work it out, it wasn't the most efficient way I think, but it works. If someone needs it, just tell me and I'll post it here. Cheers people! Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 27, 2019 Report Share Posted February 27, 2019 hi...if the DTI can be sorted from the beginning (when this is populated) you can check the valuo of the row "0" if this value is less of the row that you have to insert increase a variable to check the next row...do so on...when the result is positive (the new value is less on the read row) you can use the "insert row" UDFB...and reset the variable to check the row. I hope that my explaination is clear. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now