Function source code

Discuss the spreadsheet application

Function source code

Postby dimos19 » Sun Nov 17, 2019 9:29 pm

Where can i find the function's implementation of calc Examp. countif() ?
OpenOffice 4.1 on Windows 8.0
dimos19
 
Posts: 5
Joined: Sun Dec 14, 2014 10:07 pm

Re: Function source code

Postby Zizi64 » Sun Nov 17, 2019 9:42 pm

Do you want to modify the source code of the AOO or LO?

Or do you want call the COUNTIF function from a cell or from a macro code?

You can find the description of the function in the HELP of the AOO or LO.

COUNTIF.png
Last edited by Zizi64 on Mon Nov 18, 2019 12:09 am, edited 1 time in total.
Tibor Kovacs, Hungary; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 8542
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Function source code

Postby dimos19 » Sun Nov 17, 2019 10:26 pm

I want to see all the code of the function. The loops ,while, and the variables.
OpenOffice 4.1 on Windows 8.0
dimos19
 
Posts: 5
Joined: Sun Dec 14, 2014 10:07 pm

Re: Function source code

Postby RoryOF » Sun Nov 17, 2019 10:29 pm

Then you will have to investigate the OpenOffice source code at
http://www.apache.org/dyn/aoo-closer.cgi/openoffice/
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29899
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Function source code

Postby robleyd » Mon Nov 18, 2019 12:42 am

Or download the source in several formats from https://openoffice.apache.org/downloads.html
Cheers
David
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3057
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Function source code

Postby dimos19 » Tue Nov 19, 2019 9:37 pm

I have downloaded the code of openoffice site and i want to ask how can i see the code inside of the files. How can i open these files?
OpenOffice 4.1 on Windows 8.0
dimos19
 
Posts: 5
Joined: Sun Dec 14, 2014 10:07 pm

Re: Function source code

Postby dimos19 » Tue Nov 19, 2019 9:41 pm

ok! i managed to open it with notepad.
Thanks a lot!
OpenOffice 4.1 on Windows 8.0
dimos19
 
Posts: 5
Joined: Sun Dec 14, 2014 10:07 pm

Re: Function source code

Postby RoryOF » Tue Nov 19, 2019 9:43 pm

All the source files should open with a plain text editor.

It may be that there are specialised IDEs (Integrated Development Environments) for C++ which will also open the files. Which of these you find and choose is up to you.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29899
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Function source code

Postby Zizi64 » Tue Nov 19, 2019 9:45 pm

Sorry, we are not developers of the AOO/LO).
I never tried to browse the source code of the LibreOffice... I do not know where the code of the Calc functions are located.
Tibor Kovacs, Hungary; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 8542
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Function source code

Postby Zizi64 » Tue Nov 19, 2019 10:42 pm

If you want to write your own routines and functions, here isa possible solution (written in StarBasic) for your example task (COUNTIF()):

Code: Select all   Expand viewCollapse view
REM  *****  BASIC  *****
Option explicit

Function MyCountif(TheRange as variant, TheCondition as Variant) as long

Dim Counter as long
Dim ArrayValue as Variant

   Counter = 0
   If isarray(TheRange) then
      For each ArrayValue in TheRange
         If ArrayValue = TheCondition then Counter = Counter + 1
      next ArrayValue
   else
      If TheRange = TheCondition then Counter = Counter + 1
   end if
   
MyCountif = Counter
End function


Note: the 5 (string) and the 5 (integer) are not equal.
Tibor Kovacs, Hungary; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 8542
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Calc

Who is online

Users browsing this forum: MSN [Bot] and 43 guests