[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [CRASH REPORT] Function without String


Le 06/10/2026 à 11:08, Holger Heinemann a écrit :
Hello,

Damned, my program crashed Gambas that way :

If you forget the "as String" in "public function ReadHost()", the compiler crashes instead of issuing an error message.

Public Function ReadHost()
   Dim sFirstLine As String
   Dim hFile As File
   Dim sFilePath As String = "/host.txt"

   ' Vor dem Öffnen prüfen, ob die Datei existiert
   If Exist(sFilePath) Then
     hFile = Open sFilePath For Read
     Line Input #hFile, sFirstLine
     Close #hFile
     Return sFirstLine
   Else
     Message.Error("Die Datei host.txt wurde nicht gefunden!")
   End If
End Function

This bug should have been fixed in commit https://gitlab.com/gambas/gambas/-/commit/88cdaee005152ee7bdbd0d254845755c743f82c3.

Regards,

--
Benoît Minisini.