How to get the Program name?
For example, I write program which name is Daysleeper. An user can rename it to e.g. Daysleeper_1.0.
How to get the name at program's startup? I need to handle it within my code.
Program name
Re: Program name
Not sure if there is any other way to do it but to read the current directory contents and figure the name based out on what files you see there. But it could actually be good feature in some rare cases like yours to have way to access the name of the file that was started.
GetIconProperties() error handling
Thanks. This is one I need. I have searched through Hollywood's DOS functions only
I encountered another problem. Does the GetIconProperties() function return kind of error code if the given icon is missing? I don't want getting typical Hollywood Player message. I want to handle the error instead.
Re: Program name
How about something like this:
Code: Select all
Local type, name$=GetProgramInfo()
If Exists(name$..".info")
Local icontype, tooltypes, deftool$ = GetIconProperties(name$..".info")
; do your things here
Else
; maybe something here too
EndIf
Re: Program name
What, if I don't need icontype and deftool$ at all? Do I have to pass unused variables anyway?
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Program name
You have to pass icontype but not deftool$ in that case.