Bug 136032 - Basic Compiler Bug - incorrect syntax error message - Print #iNumber,"#"
Summary: Basic Compiler Bug - incorrect syntax error message - Print #iNumber,"#"
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
6.4.5.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.1.0 target:7.0.2 target:6.4.7
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2020-08-23 06:46 UTC by Hans-Werner
Modified: 2020-09-10 10:52 UTC (History)
4 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 Hans-Werner 2020-08-23 06:46:39 UTC
Description:
Print to file > print #iNumber,"#" < causes syntax error message "Inadmissible value or data type. Data type mismatch.", but there's no syntax error. When coding
> print #iNumber, "#" < (inserted additional blank after comma) no syntax error message is to bee seen. Important: The described error only occurs when the char to be printed to file is "#" !

Steps to Reproduce:
1. Start macro below as is.
2. Remove ' before Print and start macro below again.

Sub ExampleWorkWithAFile
Dim iNumber As Integer
Dim aFile As String
aFile = "c:\data.txt" ' May be necessary to be modified !
iNumber = Freefile
Open aFile For Output As #iNumber
Print #iNumber, "#" ' O.K.
'Print #iNumber,"#" ' Incorrect syntax error message !!!
Print #iNumber, "A#B" ' O.K.
'Print #iNumber,"A#B" ' Incorrect syntax error message
Print #iNumber, "AB" ' O.K.
Print #iNumber,"AB" ' O.K.
Close #iNumber
End Sub

Actual Results:
> Print #iNumber,"#" < and > Print #iNumber,"A#B" < cause syntax error message.

Expected Results:
> Print #iNumber,"#" < and > Print #iNumber,"A#B" < should not cause syntax error message.


Reproducible: Always


User Profile Reset: No



Additional Info:
Tested using LO6.4.6.2(x64)/LO7.0.0.3(x64) @ Windows10Home(x64).
Comment 1 Andreas Heinisch 2020-09-03 10:56:16 UTC
I can confirm the error in:
Version: 7.0.0.3 (x86)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU-Threads: 4; BS: Windows 10.0 Build 18362; UI-Render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

and in:
Version: 6.4.5.2 (x86)
Build-ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU-Threads: 4; BS: Windows 10.0 Build 18362; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 2 Commit Notification 2020-09-06 10:56:21 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/11292d1cc405e7c3b9e1f374cc7581a63a54b994

tdf#136032 - abort scan of a string beginning with a hashtag

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Hans-Werner 2020-09-07 07:04:28 UTC
Hello Andreas,
I tested the fix using daily build "LibreOfficeDev_7.1.0.0.alpha0_Win_x64.msi" (2020-Sep-07 02:47) and can confirm the "RESOLVED FIXED".
Many thanks and greetings fom Germany
Hans-Werner :-))
Comment 4 Commit Notification 2020-09-07 08:12:13 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/cc17346d682d85b6c083d76cae2d55dcc022e58f

tdf#136032 - abort scan of a string beginning with a hashtag

It will be available in 7.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2020-09-10 10:52:53 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/3c36d4921cf9d9c4fd33b3e1dd810f7a63d51695

tdf#136032 - abort scan of a string beginning with a hashtag

It will be available in 6.4.7.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.