Reverse sample

Feature requests for future versions of Hollywood can be voiced here

Reverse sample

Postby sinisrus » Thu Jan 05, 2017 6:49 pm

Hello,

Did you plan to do a function for reverse sample ?
sinisrus
 
Posts: 195
Joined: Tue Apr 21, 2015 5:43 pm

Re: Reverse sample

Postby airsoftsoftwair » Thu Jan 05, 2017 11:25 pm

Wouldn't be very difficult to do but I doubt that many people need such a feature. You can do this on your own: Get the sample data using GetSampleData(), reverse the data in the table, and then convert it back into a sample using CreateSample(). Voila. It's just a few lines of code.
User avatar
airsoftsoftwair
 
Posts: 2198
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: Reverse sample

Postby sinisrus » Fri Jan 06, 2017 12:44 am

OK Thank you
sinisrus
 
Posts: 195
Joined: Tue Apr 21, 2015 5:43 pm

Re: Reverse sample

Postby sinisrus » Sat Jan 07, 2017 11:43 am

I use :
SORT(Table,Function(a,b) Return(a>b) EndFunction)
for reverse order => The values of the items no longer appear the same
sinisrus
 
Posts: 195
Joined: Tue Apr 21, 2015 5:43 pm

Re: Reverse sample

Postby sinisrus » Mon Jan 09, 2017 4:40 pm

Ok i solved:

Code: Select all
Function ReverseItems(T)

    local i, j = 0, ListItems(T)-1

    While i < j
        T[i], T[j] = T[j], T[i]
        i = i + 1
        j = j - 1
    Wend

EndFunction
sinisrus
 
Posts: 195
Joined: Tue Apr 21, 2015 5:43 pm


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 2 guests