[Gambas-user] Application.Name ?
Hans Lehmann
hans at gambas-buch.de
Mon Sep 3 15:40:43 CEST 2018
Hello.
(1)
I create a project with the project name ´GetAppName´.
Code:
Public Sub Form_Open()
Label1.Text = "Application.Name = " & Application.Name
End
(2)
Create executable file. The default name `GetAppName.gambas` is taken
over with `OK`.
Close IDE.
(3)
Starting the executable file `GetAppName.gambas` results in the
following name for the application:
(4)
Reopen the project with the project name ´GetAppName´ in the IDE.
Create executable file. The default name `GetAppName.gambas` will be
overwritten with ´get.app.name.gambas` and accepted with `OK`.
Close IDE.
(5)
Starting the executable file ´get.app.name.gambas` results in the
following name for the application:
I had expected from the definition
/Application.Name (gb)//
//Static Property Read Name As String//
/*/Return the application name, as defined in the IDE project properties
dialog./*
that the name of the application is `GetAppName` - as in the first
picture, because I hadn't changed the name in the properties dialog in
the IDE.
I noticed this strange, unexpected result when I used the value of the
Application.Name property to create a directory ($sDataDirPath =
Desktop.DataDir &/"gambas3" &/ Application.Name &/"data") in my home
directory to export a database file. With the default executable name,
the program worked as expected. After renaming the executable by
changing all uppercase letters to lowercase and restarting the program
from the project directory, a new directory was created and there was an
empty database file. Great!
Is there an error in Gambas or is the error on my side?
With kind regards
Honsek
----[ Gambas mailing-list is hosted byhttps://www.hostsharing.net ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180903/193a8077/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmijolbicennhhgh.png
Type: image/png
Size: 8944 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180903/193a8077/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fioanjdkoakmpahm.png
Type: image/png
Size: 8746 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180903/193a8077/attachment-0003.png>
More information about the User
mailing list