GFA - Calling Zview to display a picture

GFA BASIC-related articles in here please

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

Playmobil
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Fri Nov 13, 2015 7:40 pm

GFA - Calling Zview to display a picture

Postby Playmobil » Sat May 26, 2018 1:36 pm

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: 2362
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: GFA - Calling Zview to display a picture

Postby lp » Sat May 26, 2018 1:58 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Fri Nov 13, 2015 7:40 pm

Re: GFA - Calling Zview to display a picture

Postby Playmobil » Sat May 26, 2018 2:56 pm

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: 2399
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece
Contact:

Re: GFA - Calling Zview to display a picture

Postby christos » Sat May 26, 2018 4:22 pm

You could also pexec() (or EXEC in gfabasic) to launch another application and pass parameters to it.
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org

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

Re: GFA - Calling Zview to display a picture

Postby Rajah Lone » Sat May 26, 2018 4:25 pm

@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: 2362
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: GFA - Calling Zview to display a picture

Postby lp » Sat May 26, 2018 4:27 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Fri Nov 13, 2015 7:40 pm

Re: GFA - Calling Zview to display a picture

Postby Playmobil » Sat May 26, 2018 6:44 pm

@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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Fri Nov 13, 2015 7:40 pm

Re: GFA - Calling Zview to display a picture

Postby Playmobil » Sun May 27, 2018 12:23 pm

@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: 399
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: GFA - Calling Zview to display a picture

Postby Rajah Lone » Sun May 27, 2018 1:08 pm

@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


Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 5 guests