Bug 132325 - Basic: Any keyword is not documented
Summary: Basic: Any keyword is not documented
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords: skillDocumentation, skillLibreOfficeBASIC
Depends on:
Blocks: HelpGaps-NewFeatures Macro-StarBasic Macro-Documentation
  Show dependency treegraph
 
Reported: 2020-04-22 13:21 UTC by Alain Romedenne
Modified: 2021-09-06 22:30 UTC (History)
5 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 Alain Romedenne 2020-04-22 13:21:02 UTC
Description:
Any is an alias for Variant primitive data type, Any is not documented

Example code:

Dim a As Any
Sub Main
  a = 1.25E-15
  Print a
End Sub

Steps to Reproduce:
n/a

Actual Results:
see Basic code example

Expected Results:
n/a


Reproducible: Always


User Profile Reset: No



Additional Info:
Any is a convenient shortcut worth documenting
Comment 1 Xisco Faulí 2020-05-11 10:47:32 UTC
Moving to NEW
Comment 2 Rafael Lima 2021-04-26 22:58:19 UTC
As shown in the link below, ANY is indeed a synonym for VARIANT, as pointed out by Alain (an "alias").
https://opengrok.libreoffice.org/xref/core/basic/source/comp/dim.cxx?r=b80069e1#95

The funny thing is that I was unable to find a help page dedicated to Variant.

There's a page about Basic variables, but no mention to the Variant type:
https://help.libreoffice.org/7.1/en-US/text/sbasic/shared/01020100.html?DbPAR=BASIC#bm_id3149346

The only mention to Variant I could find is here, but not very useful to explain the data type.
https://help.libreoffice.org/7.1/en-US/text/sbasic/shared/03103600.html?DbPAR=BASIC#bm_id3143267

My suggestion is to create a few examples in the "Using Variables" help page describing the Variant type and adding a note saying that "Any" is an alias for Variant.
Comment 3 Rafael Lima 2021-04-27 14:57:10 UTC
Moving this to Documentation.
Comment 4 Alain Romedenne 2021-04-28 10:11:14 UTC
As per MS doclink below, one may assume 'Any' to be solely justified for backward compatibility.
https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/error-messages/bc30828

WIN API calls is the sole situation where I've found 'Any' being used so far:
https://help.hcltechsw.com/dom_designer/10.0.1/basic/LSAZ_DECLARE_STATEMENT_EXTERNAL_C_CALLS.html
Comment 5 Commit Notification 2021-04-28 11:54:02 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/49937bb740e70e6a244f9f4e9a30b7541815e62e

tdf#132325 Improve Variant/Any documentation
Comment 6 Stéphane Guillou (stragu) 2021-09-06 22:30:32 UTC
Verified as fixed in:

https://help.libreoffice.org/7.2/en-US/text/sbasic/shared/01020100.html?DbPAR=BASIC#bm_id3149346