forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


MTZIP & Batch Extractions

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
ColdWind
Newbie


Joined: 18 Apr 2001
Posts: 12
Location: UK

PostPosted: Sat Dec 29, 2001 4:10 pm    Post subject: MTZIP & Batch Extractions Reply with quote

How can i use a list and get a program to automaticly select the next item in a loop until there are no more items...
_________________
My site @ http://ix.d2g.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Dec 29, 2001 10:15 pm    Post subject: Reply with quote

Code:
List Create,1

REM then fill this list with whatever you want.

If @greater(@count(1),0)
  Repeat
    something something here
    %A = @next(1)
  Until @null(@item(1))
End


Of course, if parsing is needed, you'll need to parse while in the loop before you actualy send the unzip or zip commands. I don't remember the commands for the mtzip.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Que
Valued Newbie


Joined: 25 Aug 2001
Posts: 38
Location: Newaygo, MICH

PostPosted: Wed Jan 02, 2002 6:56 pm    Post subject: MTZip Reply with quote

FYI - I had some difficulty with the dll files included with the mtzip.dll
The file names did not match up with what the mtzip.dll was looking for.
renaming them did not work. I ended up searching the web and finding
newer versions of the necessary files. This worked, but I had to turn off
mtzip error messages. Also, mtzip.dll requires that the 3 necessary DLL
files reside in the application directory ie. @path(%0)

I'm not sure how far you are with your zip prog, but if you want, I could
send a copy of what I threw together.... simple resizable drag drop
interface. Simply functional.... low on features, but shows the use of the command.

thx.
Que

_________________
Que
Back to top
View user's profile Send private message Send e-mail
iMPA
Newbie


Joined: 26 May 2001
Posts: 9
Location: Spain

PostPosted: Wed Jan 02, 2002 10:06 pm    Post subject: Reply with quote

simple, not optimized, dirty and ugly piece of code... nor it works...
extract all files in the zip to the zip directory...

Code:

directory change,@path(%0)
rem external mtzip.dll
title zip xtractor
  DIALOG CREATE,zip xtractor !!!,-1,0,350,268,nomin,dragdrop
  DIALOG ADD,STYLE,STYLE,Tahoma,10,B,BACKGROUND,BLACK
  DIALOG ADD,LIST,LISTa,2,2,346,200,sorted,style
  DIALOG ADD,STATUS,STATUS,zip xtractor !!,style
DIALOG ADD,BUTTON,vamos,205,2,346,40,- GO -,style,default
  DIALOG SHOW
:Evloop
  wait event
  goto @event()
:DRAGDROP
  list dropfiles,lista
  goto evloop
:vamosBUTTON
  MTZIP MESSAGES,ERRORSONLY
  %i = 0
  repeat
      list seek,lista,%i
    MTZIP LOAD,ZIPFILE,@item(lista)
    DIRECTORY CHANGE,@path(@item(lista))
    %j = 0
    :repeat
    mtzip add,buffer,@mtzip(zipfile,%j)
    if @ok()
      %j = @succ(%j)
      goto repeat
    end
     mtzip process,extract   
    mtzip clear,buffer
    %i = @succ(%i)
  until @equal(%i,@count(lista))      
  list clear,lista   
  goto evloop
:Close
  exit

_________________
share what you know, learn what you don't
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ColdWind
Newbie


Joined: 18 Apr 2001
Posts: 12
Location: UK

PostPosted: Wed Jan 02, 2002 10:11 pm    Post subject: MTZip Reply with quote

Que wrote:

FYI - I had some difficulty with the dll files included with the mtzip.dll
The file names did not match up with what the mtzip.dll was looking for.
renaming them did not work. I ended up searching the web and finding
newer versions of the necessary files. This worked, but I had to turn off
mtzip error messages. Also, mtzip.dll requires that the 3 necessary DLL
files reside in the application directory ie. @path(%0)

I'm not sure how far you are with your zip prog, but if you want, I could
send a copy of what I threw together.... simple resizable drag drop
interface. Simply functional.... low on features, but shows the use of the command.

thx.
Que


Yer please could i get that from you... that would be great...
please mail it to craiglongford@hotmail.com, thanks...

_________________
My site @ http://ix.d2g.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Jan 03, 2002 12:46 am    Post subject: Reply with quote

I've had problems with @next() being dependable. I use
a method similiar to iMPA for REPEAT/UNTIL Loops:
Code:

if @greater(@count(1), 0)
   %x = 0
   REPEAT
     %%getinfo = @item(1, %x)
     %x = @succ(%x)
   UNTIL @equal(%x, @count(1))
end

_________________
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
View user's profile Send private message Send e-mail
Que
Valued Newbie


Joined: 25 Aug 2001
Posts: 38
Location: Newaygo, MICH

PostPosted: Thu Jan 03, 2002 7:54 pm    Post subject: Repeat Reply with quote

I used the following:

REPEAT
mtzip add,buffer,@next(1)
UNTIL @not(@ok())

This doesn't require a separate count variable

_________________
Que
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Jan 04, 2002 10:23 pm    Post subject: Reply with quote

That's true, but on my Win95 system @next() does NOT
work correctly all the time (and apparently on others also).
It does work most of the time, and I'd prefer to use it were
it dependable.

A couple of weeks ago I was helping an individual with
a VDS program at a genealogical library, and I sent him
a routine using @next(). It worked perfectly with the
small sample data file he sent, but when he tried the
larger data file, it quit. So I sent the method with the
incrementing variable, and it worked fine.

This wasn't the first time I've had problems with it, but
it's probably the last time I'll try to use it. If you want
a routine to work correctly on all platforms and situations,
I'd go with the incrementing variable and @item().

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
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Jan 04, 2002 11:01 pm    Post subject: Reply with quote

Mac,

I don't think @next() is platform dependend. Anyway, you may want to try to combine it with the @index() function. Also sometimes you may have to use list seek to set the index pointer as appropriate. If you utilize it correctly, it won't trouble. Remember that @next(), like @item() returns the current item, and only once it's returned, it increases the index pointer by one. @count() returns one higher number than the numbers returned by @index(), as the indexes start by 0.

Code:

  list create,1
  list loadtext,1
"1
"2
"3
"4
  repeat
    info @next(1)
  until @greater(@index(1),@pred(@count(1)))



Tommy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Jan 04, 2002 11:32 pm    Post subject: Reply with quote

I know exactly how @next() works Tommy. I've tried many
times to use it, and it works fine MOST of the time, especially
on smaller programs.

I'm just sharing my experience with it. The platform may not
have anything to do with it, but the more complicated the code,
the less dependable it is (especially in loops).

Like I said, if it was dependable I'd prefer using it.

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group