[Solved] Basic and Python, JS or BS

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
User avatar
einstein
Posts: 47
Joined: Sat Nov 05, 2016 1:45 am
Location: State of Mexico, México.

Re: Basic Vs. Python, JS or BS

Post by einstein »

Hi Zizi64,
I do not use Writer, Impress or Base and I have no interest in making macros in these programs.
Speaking of Calc, I could also use a macro like this:

Code: Select all

Sub Ordenar
 dim aSortFields(0) as new "com.sun.star.table.TableSortField"
 aSortFields(0).Field = 0
 aSortFields(0).IsAscending = true
 aSortFields(0).IsCaseSensitive = false
 dim aSortDesc(1) as new com.sun.star.beans.PropertyValue
 aSortDesc(0).Name = "SortFields"
 aSortDesc(0).Value = aSortFields
 aSortDesc(1).Name = "ContainsHeader"
 aSortDesc(1).Value = true
thiscomponent.sheets(0).getcellrangebyname("A1:E50001").sort(aSortDesc) 
End Sub
lo 5.1.6.2 | aoo 4.1.3 | win 7/10
All I know is that I know nothing
User avatar
einstein
Posts: 47
Joined: Sat Nov 05, 2016 1:45 am
Location: State of Mexico, México.

Re: Basic Vs. Python, JS or BS

Post by einstein »

karolus:
It is unintelligible what you say in your last post.
Well, you had the last word.
I give the subject as solved.
I already have an idea of what I was looking for.
My final conclusion to my goals would be this:
multiplying a range by 10 as you have done with Python shows interesting things and it is clear the best performance of Python over Basic.
However, in 64000 cells (assuming they all had numbers) the difference between Python and Basic is only 2 seconds in favor of Python (on my computer)
Thanks to all who participated in this debate, I read one by one carefully all his messages.
lo 5.1.6.2 | aoo 4.1.3 | win 7/10
All I know is that I know nothing
User avatar
einstein
Posts: 47
Joined: Sat Nov 05, 2016 1:45 am
Location: State of Mexico, México.

Re: [Solved] Basic Vs. Python, JS or BS

Post by einstein »

karolus:
what a surprise, for using your Python macro and your file, I have all day with this, LibreOffice does not work ... what time saving? :lol:

If I say what I think ...... the moderators would not be happy with my words.

So I'll just say this ..... PLONK! ¡¡¡¡ :lol:
and This: Do you really know how to develop software ?? .....
action, not words.

anyway .....

Image
Last edited by einstein on Sat Nov 12, 2016 12:47 am, edited 2 times in total.
lo 5.1.6.2 | aoo 4.1.3 | win 7/10
All I know is that I know nothing
User avatar
karolus
Volunteer
Posts: 1160
Joined: Sat Jul 02, 2011 9:47 am

Re: [Solved] Basic Vs. Python, JS or BS

Post by karolus »

I'm not sure what youre doing, but please copy nothing into path ……/user/uno_packages because its simple python_code, no Extension.

copy the sourcecode into …/users/Scripts/python/<filename_of_youre_choice>.py
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
User avatar
einstein
Posts: 47
Joined: Sat Nov 05, 2016 1:45 am
Location: State of Mexico, México.

Re: [Solved] Basic Vs. Python, JS or BS

Post by einstein »

karolus: Sincerely thank you very much for your participation in this debate. And sincerely I appreciate your time.
I already have an idea of the differences between Basic and Python in Calc.
The subject is solved, thank you.
Until next time.
Last edited by einstein on Fri Nov 11, 2016 8:14 pm, edited 1 time in total.
lo 5.1.6.2 | aoo 4.1.3 | win 7/10
All I know is that I know nothing
User avatar
Hagar Delest
Moderator
Posts: 32666
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] Basic Vs. Python, JS or BS

Post by Hagar Delest »

Glad to see this topic is ending like that.
As moderators, we were monitoring this topic closely because language in some posts was not of the best quality, which is rather unusual in this forum.

Thanks.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Post Reply