Bug 30524 - BASIC macro language is crippled.
Summary: BASIC macro language is crippled.
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-30 18:54 UTC by temp account
Modified: 2010-10-01 02:17 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description temp account 2010-09-30 18:54:48 UTC
Perhaps this can be fixed. Here's a script that looks like it should work, but it doesn't:
========================
function cell(sht,x,y)
   cell = ThisComponent.Sheets.getByName(sht).getCellByPosition(x,y)
end function

function simple(arg)
   '' Just returns the arg
   simple = arg
end function

function call_it(fn)
   call_it = fn("Hello!")
end function

sub main
   cell("Sheet1",0,0).String = call_it(simple)
end sub
=========================

When the "main" macro is run, the script fails while evaluating SIMPLE, complaining that "arg is not optional".
Comment 1 Noel Power 2010-10-01 02:17:31 UTC
(In reply to comment #0)

> When the "main" macro is run, the script fails while evaluating SIMPLE,
> complaining that "arg is not optional".

as it should do, simple is called with no arguments

call_it(simple) = call_it(simple())
                                ^^

I see what you intend ( and it confused me into thinking this was a real bug first ) but the macro code is behaving perfectly as it should. I think you thought that perhaps simple was passed as some sort of functor to be called by call_it sorry, this just cannot work.