[Solved] Sort the array in my VBA code

Creating a macro - Writing a Script - Using the API

[Solved] Sort the array in my VBA code

Postby gutee » Mon Jan 21, 2019 9:01 am

I have one array, the element is string.
how can I sort the array easily, any function available ?
my_arr(0) = "ccc"
my_arr(1) = "bbb"
my_arr(2) = "aaa"

I need get a sorted array :
my_new_arr(0) = "aaa"
my_new_arr(1) = "bbb"
my_new_arr(2) = "ccc"
Last edited by robleyd on Tue Jan 22, 2019 4:32 am, edited 1 time in total.
Reason: Tagged [Solved]
OpenOffice.org.3.3.0
gutee
 
Posts: 19
Joined: Wed Jan 09, 2019 9:12 am

Re: Sort the array in my VBA code

Postby JeJe » Mon Jan 21, 2019 12:14 pm

Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 431
Joined: Wed Mar 09, 2016 2:40 pm

Re: Sort the array in my VBA code

Postby Lupp » Tue Jan 22, 2019 12:39 am

(Why VBA? This is not an MS forum.)

What expectations are there concerning the efficiency? How long (maximum) will the array be that needs sorting?
Will next time probably be accompanying data needing to be included with the sorting?
Is the surrounding application Calc or something else?
How shall 'Empty' data (strings) be treated?
On Windows 10: LibreOffice 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2348
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Sort the array in my VBA code

Postby gutee » Tue Jan 22, 2019 3:20 am

Oh, sorry, i'm a beginner. this should be OOo Basic code, right?
Thanks.
OpenOffice.org.3.3.0
gutee
 
Posts: 19
Joined: Wed Jan 09, 2019 9:12 am

Re: Sort the array in my VBA code

Postby gutee » Tue Jan 22, 2019 4:15 am

JeJe wrote:https://wiki.openoffice.org/wiki/Sorting_and_searching

Thanks, this works pretty good!
OpenOffice.org.3.3.0
gutee
 
Posts: 19
Joined: Wed Jan 09, 2019 9:12 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 5 guests