English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 27 April 2010, 20:34   #1
lloyd
Mehh :D
lloyd's Avatar
 
Join Date: Nov 2004
Location: Bristol, SW UK
Age: 56
Posts: 242
can I?

Can I call an AmigaDOS script from a program written in (say) Blitz Basic 2? If so, how easy would it be to pass a variable from the BASIC program into the AmigaDOS script?

Or, maybe I'm looking at the program I want to write in the wrong way:

I want to write a front end type program, to give a few options (DMS > ADF, ADF > DMS etc) that goes through a directory listing of DMS files, takes each filename.dms in order, then formats, unpacks the DMS to disk, and then writes the disk just written out to an ADF file as filename.adf (and vice-versa if I choose).

I know DMS doesn't need the disk to be formatted etc but formatting the floppy will give some kind of basic indication of the floppy being bad. This is to be run on real hardware on (in some cases) 20 year old floppies!

Anybody know why FORMAT DRIVE DF0: NAME Empty NOICONS doesn't work in UAE if it's part of a script? I've tried it, as a direct command, it works fine and formats the (virtual) disk image (same goes for ADF2DISK). Yet as part of a script, FORMAT bombs out with errors. The same script works fine on my real A1200.
lloyd is offline  
Old 27 April 2010, 20:56   #2
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,560
Yes you can! (c) Obama.

So um, you want to convert DMS to ADF. Any special reason?
Photon is online now  
Old 27 April 2010, 21:25   #3
lloyd
Mehh :D
lloyd's Avatar
 
Join Date: Nov 2004
Location: Bristol, SW UK
Age: 56
Posts: 242
Only for my own reasons - I have a LARGE collection of DMS files from the 17 bit CD series, plus loads more on the UPD Gold series etc - I just want them as ADF's as well as DMS's

You probably know, that these CDs contain a lot of undocumented images, and the contents of the catalogue text files aren't exactly accurate either - lots of disks mentioned but no disk image for that particular cat entry. so, I want to re-catalogue them and put them onto a proper database
lloyd is offline  
Old 27 April 2010, 22:05   #4
Coagulus
Gets there in the end...

Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 624
I'm sure you could run executables from Blitz as I used to do it, can't remember how though. Might have been using Brexx to type things into an AmigaDOS window but I could be wrong, it's been a while!
Coagulus is offline  
Old 28 April 2010, 02:50   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,161
Quote:
Originally Posted by lloyd View Post
Anybody know why FORMAT DRIVE DF0: NAME Empty NOICONS doesn't work in UAE if it's part of a script? I've tried it, as a direct command, it works fine and formats the (virtual) disk image (same goes for ADF2DISK). Yet as part of a script, FORMAT bombs out with errors. The same script works fine on my real A1200.
I just ran the format command in a script both using execute and by running the script directly with the script flag set on the file, and it worked fine. I had nothing in my script except that single format command, maybe something else in your script is causing it to fail?

You can receive and use arguments to your script just like this if you have Kickstart 2.0 or higher:

Code:
.key some,thing
format drive <some> name <thing> noicons
There is a help file for Blitz Basic 2 that should explain string handling and system calls. If the script still fails you could just do away with it and call the individual commands directly from within Blitz.
Leffmann is offline  
Old 28 April 2010, 04:40   #6
lloyd
Mehh :D
lloyd's Avatar
 
Join Date: Nov 2004
Location: Bristol, SW UK
Age: 56
Posts: 242
Ah.....

Now you seem to be telling me that I can write the whole thing in Blitz?

Can I use an AmigaDOS command within Blitz then? I assumed I'd have to call an AmigaDOS script. Can I call other programs within Blitz too, such as adf2disk? Things would be sooo much simpler if I could..... AmigaDOS would do all the hard work etc but I don't think it's good at creating a GUI

the first line of the test script is Format drive df0: name Empty noicons - followed by a simple DMS write command. It's falling down on the format drive command. I have a screenshot but can't upload it.

UAE gives:
Format failure: wrong number of arguements
Format failed returncode 20

I then typed the command in by hand, no problem. Just one of those things I guess

Anyhoo guys, cheers for the info, I'd best get learning Blitz
lloyd is offline  
Old 28 April 2010, 11:53   #7
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,161
I still think that doing the work in a script is the easiest way. The error says there are too many arguments, maybe the cat has been sitting on the space bar and there's some junk past the screen border

In any case, in Blitz you can call outside programs like this:

Code:
d$="df0:"
n$="empty"
Exec "format drive "+d$+" name "+n$+" noicons"
But Blitz seem to block all in- and output from its own console window, so programs like Format that prompts you to press return won't run properly, and I'ven no idea how to work around that.
Leffmann is offline  
Old 29 April 2010, 12:53   #8
lloyd
Mehh :D
lloyd's Avatar
 
Join Date: Nov 2004
Location: Bristol, SW UK
Age: 56
Posts: 242
Could I maybe run a script then from Blitz? If I can use exec, can I simply use it to call execute?

Sorry to be such a noob
lloyd 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 15:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07193 seconds with 12 queries