Copying files in amos

Started by rja4096, November 22, 2007, 10:51:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rja4096

Hi, I'm nearly ready to show you all my driving game, just one thing, how do I get amos to copy some files from code. it must be possible.

Please let me know, thanks, Rick.

rednova

Friend:
I am looking forward to see your game. You need to copy an amos code file? The easy way to do that would be to open/load the code in amos, then 'save as' and save under a different name.
Cheers!!!

rednova
-mobilis in mobile-
-mobilis in mobile-

rja4096

Hi, I'm looking forward to seeing my game too!

No, sorry I was not clear, about copying files. What i have is 30 IFF files, an amimation done in Dpaint, which is an amimation of a road moving. I need top copy these from disk to RAM disk. When the program runs it loads these one by one and displays on the screen, then mack to the start. I could create a script and have the CLI copy the files, but would like this all to be done in AMOS if possible.

Thanks, Rick.

Spellcoder

#3
METHOD 1 - use an external copy command
If you're using AMOSPro you could use the Exec instruction.

Exec 'copy oldfile RAM:newfile'

If you use the old AMOS you could use an =Doscall for the same effect.


METHOD 2 - use an extension
Maybe one of the extensions has a instruction for copying.


METHOD 3 - code your own copy function
Otherwise To do it without the C:Copy file you'd have to open the old and new file
and then load part of the file, save that part, load the next part etc.
This way you don't need an external command or extension.
The reason to do the copying in pieces is to save memory and can halfway stop your program.


edit: fixed links.. apparently the forum software doesn't like me to quote the URL :P
edit (feb 2008): updated the links

SamuraiCrow

Actually you could use RedNova's suggestion (assuming that each frame is a static IFF image):

For I=1 to 30
  Load IFF "filename"+Str$(I)
  Save IFF "ram:filename"+Str$(I)
Next I


rednova

Samurai Crow:

hehe thanks for mentioning my name!!! Now i feel really good!!!
cheers!!!

rednova
-mobilis in mobile-
-mobilis in mobile-

Tarzin

QuoteExec 'copy oldfile RAM:newfile'
This method is working fine! Thanks for the tip.
I've used it for my AmosPro's french installer.

QuoteIf you use the old AMOS you could use an =Doscall for the same effect.
Althought, this link is broken.
Power User! :-)
A500/1Mo + 2nd floppy drive

WinUAE 1.5.x / OS 3.9 BB2 / Amikit 1.x.
http://amifrance.hw.tc/

AmiGame, Ultimate FrontEnd for WinUAE!
http://www.amigame.fr/

SamuraiCrow


woody.cool

Sorry to resurrect an old thread, you can copy files thus:

Openin 1,src$
l=lof(1)
reserve as work 1,l
close 1
bload src$,1
bsave dest$,start(1) to start(1)+l
erase 1


You can use that to copy ANY file, be it ASCII or binary.
Another option, if you have AMCAF, you'll have the FILE COPY command available to you ;)