GFA - Calling Zview to display a picture

GFA BASIC-related articles in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
Playmobil
Captain Atari
Captain Atari
Posts: 172
Joined: Fri Nov 13, 2015 7:40 pm

GFA - Calling Zview to display a picture

Post by Playmobil »

Hi !

In my programm I need to call ZView to display a picture...

This code :

Code: Select all

~SHEL_WRITE(1,1,0,"C:\PICTURE.TGA","C:\ZVIEW\ZVIEW.APP")
launch Zview, but no picture is loaded... :(

Of course, if I double-clic on PICTURE.TGA from the desktop, ZVIEW load & display this picture...

Which argument is needed to Zview to load & display the file ? I have read the doc of ZView, but mention about this...

Thanks in advance.

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2490
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: GFA - Calling Zview to display a picture

Post by lp »

It might be that shel_write() does not format the command line for you. Try this:

Code: Select all

file$="C:\PICTURE.TGA"
c$=CHR$(LEN(file$))+file$
~SHEL_WRITE(1,1,0,c$,"C:\ZVIEW\ZVIEW.APP")

Playmobil
Captain Atari
Captain Atari
Posts: 172
Joined: Fri Nov 13, 2015 7:40 pm

Re: GFA - Calling Zview to display a picture

Post by Playmobil »

Wow !!! Your a Genius Lonney ! It's working now !!! :cheers:

My programm launch a TTP too, and working without formated command, strange...

About the TTP, there is a trick, for waiting a key press at the end ? Because the console windows close immediatly at the end, and if there are errors I have no time too see what it is...

(And of course the log file of Toswin2 is empty...)

P.S : Sorry my english is so bad...


EDIT : How to know if Zview already running ? Because SHEL_WRITE(1,x,x,x,x) launch an other instance of ZView... Is it possible ? (a Cookie to test ?)

EDIT2 : May Be APPL_FIND("ZVIEW.APP") ? Need to try !

User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2475
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece

Re: GFA - Calling Zview to display a picture

Post by christos »

You could also pexec() (or EXEC in gfabasic) to launch another application and pass parameters to it.

User avatar
Rajah Lone
Captain Atari
Captain Atari
Posts: 454
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: GFA - Calling Zview to display a picture

Post by Rajah Lone »

@Playmobil: VA_START if Zview is already there. You should look in my program sources, at the HYP file to open by ST-GUIDE or HYPVIEW.

The other way, if multitasking environment, is to call the desk directly with the TGA file. The user should have configured TGA file, with the prefered viewer in desktop options

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2490
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: GFA - Calling Zview to display a picture

Post by lp »

Glad to help. You can use appl_find() to check if zview is already running. You only need the base filename and it must be padded to 8 characters with spaces.

Code: Select all

find$="ZVIEW"
status&=APPL_FIND(LEFT$(find$+SPACE$(8),8))
TosWin2 has an option to write log file: Options -> Config console
Set the path to the log file and enable it.

Rajah's suggestion is good. If you use AV Protocol, zview would open another window for a 2nd image instead of launching another instance of zview.

Playmobil
Captain Atari
Captain Atari
Posts: 172
Joined: Fri Nov 13, 2015 7:40 pm

Re: GFA - Calling Zview to display a picture

Post by Playmobil »

@lp : TosWIN2 habe this option checked, but the log file is empty...

For APPL_FIND, yes with 8 characters, it's better ! ^^ If not, always return -1 :D

I go to look Rajah's code (again & again !) for VA_Start, it's what I need ! :wink:

Playmobil
Captain Atari
Captain Atari
Posts: 172
Joined: Fri Nov 13, 2015 7:40 pm

Re: GFA - Calling Zview to display a picture

Post by Playmobil »

@Rajah : Sorry but your code is a high-level for me ! :lol:

I understand we need to reserve memory to stock the command argument inside, get the ap-id of Zview in this case, there is no GFA direct function about AV_Protocol so need to call GEMDOS, but after I'm lost !

Where can I find a simple exemple in GFA ? Old magasine or diskmag... (French or English, I read English more than I write it !)

Rajah, I see you have wrote an article in Stimulus #8 about drag & drop... Drag&Drop use AV-Protocol, no ? Infortunnaly, all links are dead, do you have it anymore ?
Edit : FOUND IT ! => http://ptonthat.fr/QM/STIMULUS.08/

User avatar
Rajah Lone
Captain Atari
Captain Atari
Posts: 454
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: GFA - Calling Zview to display a picture

Post by Rajah Lone »

@Playmobil: VA_START uses 'tube GEM' with appl_write() function, Drag'n'Drop uses GEMDOS calls. That's different, and VA_START is easier than D&D.

http://toshyp.atari.org/en/Application.html#appl_write
http://toshyp.atari.org/en/00f001.html
http://toshyp.atari.org/en/00f001.html#VA_START

Post Reply

Return to “GFA BASIC”