Program name

Anything related to Hollywood Designer goes in here
Post Reply
User avatar
r-tea
Posts: 80
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

Program name

Post by r-tea » Sun Aug 27, 2017 8:38 pm

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: 692
Joined: Sun Feb 14, 2010 8:11 pm

Re: Program name

Post by Bugala » Sun Aug 27, 2017 8:58 pm

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: 8
Joined: Sun Feb 14, 2010 7:06 pm

Re: Program name

Post by Tipsi » Sun Aug 27, 2017 9:46 pm

Hi r-tea

See the function GetProgramInfo()

Griessli
Tipsi

User avatar
r-tea
Posts: 80
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

GetIconProperties() error handling

Post by r-tea » Mon Aug 28, 2017 7:21 am

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: 156
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO
Contact:

Re: Program name

Post by jPV » Mon Aug 28, 2017 5:39 pm

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: 80
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

Re: Program name

Post by r-tea » Mon Aug 28, 2017 5:44 pm

What, if I don't need icontype and deftool$ at all? Do I have to pass unused variables anyway?

User avatar
airsoftsoftwair
Posts: 2573
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Program name

Post by airsoftsoftwair » Tue Aug 29, 2017 5:42 pm

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

Post Reply