Jump to content

Sorting Data Tables or 2 Arrays


GonzaloRoldan_

Recommended Posts

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

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

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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.