Program name

Anything related to Hollywood Designer goes in here

Program name

Postby 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.
User avatar
r-tea
 
Posts: 59
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland

Re: Program name

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

Re: Program name

Postby Tipsi » Sun Aug 27, 2017 9:46 pm

Hi r-tea

See the function GetProgramInfo()

Griessli
Tipsi
Tipsi
 
Posts: 6
Joined: Sun Feb 14, 2010 7:06 pm

GetIconProperties() error handling

Postby 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
r-tea
 
Posts: 59
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland

Re: Program name

Postby 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
jPV
 
Posts: 87
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO

Re: Program name

Postby 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
r-tea
 
Posts: 59
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland

Re: Program name

Postby airsoftsoftwair » Tue Aug 29, 2017 5:42 pm

You have to pass icontype but not deftool$ in that case.
User avatar
airsoftsoftwair
 
Posts: 2240
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany


Return to General questions

Who is online

Users browsing this forum: No registered users and 2 guests

cron