Program name

Anything related to Hollywood Designer goes in here
Post Reply
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Program name

Post by r-tea »

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.
Bugala
Posts: 1168
Joined: Sun Feb 14, 2010 7:11 pm

Re: Program name

Post by Bugala »

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.
Tipsi
Posts: 21
Joined: Sun Feb 14, 2010 6:06 pm
Location: Switzerland

Re: Program name

Post by Tipsi »

Hi r-tea

See the function GetProgramInfo()

Griessli
Tipsi
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

GetIconProperties() error handling

Post by r-tea »

Tipsi wrote:Hi r-tea

See the function GetProgramInfo()

Griessli
Tipsi
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.
User avatar
jPV
Posts: 600
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Program name

Post by jPV »

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      
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: Program name

Post by r-tea »

What, if I don't need icontype and deftool$ at all? Do I have to pass unused variables anyway?
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Program name

Post by airsoftsoftwair »

You have to pass icontype but not deftool$ in that case.
Post Reply