| View previous topic :: View next topic |
| Author |
Message |
Magnus Newbie
Joined: 09 Sep 2003 Posts: 3
|
Posted: Fri Dec 19, 2003 9:13 am Post subject: Appending contents in files |
|
|
Hi,
I would like to append the contents from several files into a new file, but I can't get it to work. The files can become quite large (up to 1Mb, maybe more)
I've been looking into BINFILE and @BINFILE but I cannot get it to work only looking in the helpfiles.
I did some work in VDS 3.5 a couple of years ago, but I still considder me a VDS newbee. I'm using the latest evaluation copy of VDS to see if I can solve the functionallity I am after.
Cheers,
Magnus |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Dec 19, 2003 10:42 am Post subject: |
|
|
hi magnus,
you really need to show us the code that you have used to append the lists...folks will then be able to help you work out why it doesn't work
serge _________________
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Dec 19, 2003 2:46 pm Post subject: |
|
|
come to think of it...doesn't dos have a append command that appends 2 files together??!? i vaguely remember something like it...
if it did, you could use vds to run the dos append command with the right switches and parameters
serge _________________
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Dec 19, 2003 4:06 pm Post subject: |
|
|
-
Unfortunately, the later versions of VDSug.dll have been
removed from VDSworld. The link CodeScript provided is
an old version that does NOT have file IO.
The latest (free) VDSug.dll version with file IO, draw.dll
functions and many other features can be downloaded
here:
http://www.trinex.net/users/mac/vdsug/
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sat Dec 20, 2003 1:20 am Post subject: |
|
|
Hi Magnus,
Here is some example code you can use with Mac's excellent vdsug.dll to append a group of bitmap files that reside in the same folder. (In essence, the attached code is a basic resource compiler.)
You can shape the code to meet your needs (and use the offsets to extract the original files--if needed).
I set the buffer for 1 MB, but the buffer might need to be adjusted depending on file size... (If the total of all files is over 1 MB, then you'll need to "up" the buffer size.)
Cheers!
- Boo
| Code: |
#define command,ug
EXTERNAL @path(%0)vdsug.dll
%%bufsize = @ug(FILEREADBUFSIZE, 1000000)
file delete,@path(%0)myfile.dsr
%%offset = 0
%%offstring = 0
list create,4
list filelist,4,@path(%0)*.bmp
info @count(4) bitmap files will be appended to one file...
UG FILEOPEN, 1, @path(%0)myfile.dsr, READ|WRITE
repeat
%%next = @next(4)
if @null(%%next)
goto finish
end
UG FILEOPEN, 2, @shortname(%%next), READ|WRITE
%%size = @file(%%next,Z)
%%offset = @fadd(%%offset,%%size)
%%offstring = %%offstring|%%offset
UG FILEREAD, 2, RAWDATA, 0
%%size2 = @ug(FILEGETSIZE, 1)
%%newpos = @ug(FILESETPOS, 1, %%size2)
UG FILEWRITE, 1, RAWDATA, !BUFFER!
until @null(%%next)
:finish
info Here are the offsets for use in VDS as resources:@cr()@cr()%%offstring
UG FILECLOSE, 1
UG FILECLOSE, 2
|
|
|
| Back to top |
|
 |
|