Bug 146902 - Show results from Basic examples given in help text
Summary: Show results from Basic examples given in help text
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
7.3.0.2 rc
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on: 129436
Blocks: HelpGaps-NewFeatures
  Show dependency treegraph
 
Reported: 2022-01-21 19:47 UTC by Jim Avera
Modified: 2024-08-19 03:51 UTC (History)
3 users (show)

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 Jim Avera 2022-01-21 19:47:16 UTC

    
Comment 1 Jim Avera 2022-01-21 19:53:00 UTC
The LO docs for Basic functions contain many examples, but almost none of them disclose the output which would be obtained by running them -- it is "left as an exercise for the reader" to copy-paste the examples into some spreadsheet's Basic macro code and run them to see what happens.

It would be a great enhancement if the output from examples were just shown directly in the help text.



Here is an illustrative example: 

The DatePart() function is documented at 
  https://help.libreoffice.org/6.2/en-US/text/sbasic/shared/03030130.html

It ends with

  Example:

  Sub example_datepart
      MsgBox DatePart("ww", "12/31/2005")
  End Sub

but does not show what the output would be.
Comment 2 fpy 2024-03-13 13:53:53 UTC
136 functions
+22 VBA)

The followinge have results in comments :
03120101.xhp Asc
03120111.xhp AscW
03100300.xhp CDate
03030108.xhp CDateFromIso
03030101.xhp DateSerial
03020404.xhp Dir
03130800.xhp Environ
03050300.xhp Error
03080501.xhp Fix
03120301.xhp Format
03080503.xhp Frac
03080801.xhp Hex
03080502.xhp Int
03102300.xhp IsDate
03102400.xhp IsEmpty
03102700.xhp IsNumeric
03104500.xhp IsUnoStruct
03102900.xhp LBound
03120302.xhp LCase
replace.xhp Replace
03080701.xhp Sgn
03120403.xhp StrComp
03090410.xhp Switch
03030303.xhp Timer
03103000.xhp UBound
03120310.xhp UCase

Some examples with results are grouped : CInt, CDbl, CLng ...


Some results may not be so useful :
- obvious : Abs, Cos, Sin
- contextual :  FileAttr, FileExists, FileLen, Curdir, Time, ...
- abstract : createObject, IsObject


So, sounds more like a case by case task here. 
An annotation mechanism may help.
Comment 3 Commit Notification 2024-03-14 19:45:40 UTC
Pierre F committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/e48c06ba931d5da0371c2e9b64158aebfbbd9f49

tdf#146902. add DatePart results
Comment 4 fpy 2024-03-14 20:15:28 UTC
interestingly, there's a list here :
https://wiki.documentfoundation.org/Documentation/Calc_Functions/List_of_Functions
including details and results.

so maybe we could link the help pages to their corresponding wiki ?