English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 19 June 2017, 21:26   #1
r-tea
Registered User
 
r-tea's Avatar
 
Join Date: Apr 2017
Location: Zdzieszowice / Poland
Posts: 17
Question [E] argc, argv example

I need an AmigaE example how to get program name while executing from icon. I know there is an easy to use GetProgramName() function of AmigaOS, but it reads only from CLI/Shell.
r-tea is offline  
Old 19 June 2017, 22:20   #2
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
I've never used E and I don't know how OS stuff is handled there (you know OS calls, OS structures). But when your program started from WB and you sure about that, then you have (after callsys GetMsg) as answer structure WBStartup and there you can find sm_NumArgs and sm_ArgList.
Asman is offline  
Old 19 June 2017, 23:20   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
http://cshandley.co.uk/JasonHulance/beginner_163.html
idrougge is offline  
Old 19 June 2017, 23:28   #4
r-tea
Registered User
 
r-tea's Avatar
 
Join Date: Apr 2017
Location: Zdzieszowice / Poland
Posts: 17
Thank You!
I've managed in other way. I found 'workbench/startup' module with wbstartup object defined.
In short:

Code:
...
MODULE 'workbench/startup'
...
DEF startup:PTR TO wbstartup, args:PTR TO wbarg
...
	startup := wbmessage
	args := startup.arglist
	WriteF('\s\n', args[].name)
...
Done in hurry, without any error handling.
:-)
But it works.
r-tea is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:57.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06941 seconds with 14 queries