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 


10,000 plus lines of text, too big and slow for .TXT ???

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


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Apr 02, 2004 6:47 pm    Post subject: 10,000 plus lines of text, too big and slow for .TXT ??? Reply with quote

I have 10,000 plus lines of text, and its too big and slow for a TEXT file (.TXT)

I have to sort the LIST, then save its to file, and delete 1 at a time till its all sorted.

Is there a way to do it in memory instead of Hardrive text file?

Thanks
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Apr 02, 2004 7:30 pm    Post subject: Reply with quote

I re-edited it and the below is an easier Example to see how writing to the Hardrive is too slow, as you all may allready know this.

Code:
Title vtol script
DIALOG CREATE,Test BackCounter,-1,0,190,190
DIALOG ADD,EDIT,browserbox,89,36,58,17,,
DIALOG ADD,BUTTON,test,150,35,43,19,Test,,
DIALOG ADD,BUTTON,cancel,150,125,43,19,Exit,,
DIALOG SHOW

  LIST CREATE,1
  LIST CREATE,2

:LOOP 
 WAIT EVENT 
 GOTO @EVENT() 

rem  Make sure the c:\test\bigtest.txt file contains about 10,000 lines to test
rem  all this properly...

:testBUTTON
FILE copy,c:\test\bigtest.txt,c:\test\test.txt
REPEAT
    LIST loadfile, 1,c:\test\test.txt
    %%test = @pred(@count(1))
    LIST APPEND, 2,@item(1)
 IF @EVENT(cancelBUTTON)
  goto close
 end
DIALOG SET,browserbox,%%test
    LIST DELETE, 1
    LIST saveFILE, 1,c:\test\test.txt
UNTIL @equal(%%test, 0)
    LIST CLEAR, 1
    LIST append, 1, 2
    LIST saveFILE, 1,c:\test\final.txt
info done
  goto LOOP

:cancelBUTTON
:close
LIST close,1
LIST close,2
exit


But I would like to find a faster method, maybe API or memory...
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


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

PostPosted: Fri Apr 02, 2004 11:28 pm    Post subject: Reply with quote

If you mean a standard SORT - ya can use a sorted list:

LIST CREATE, 1, SORTED

Maybe a more detailed explanation of what your app needs
to do? Wink

Cheers, Mac Smile

_________________
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
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Apr 02, 2004 11:42 pm    Post subject: Reply with quote

naa, I knew about SORTED paramenter Smile


I just need a way to optimize the speed of that type of script if theres a way, because when you load a text file with around 10,000 lines, its takes forever to get done...
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


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

PostPosted: Sat Apr 03, 2004 12:12 am    Post subject: Reply with quote

VDS lists aren't very efficient for large files - you should
prolly be using direct file access with either the @binfile()
function or VDSug.dll's file IO - which has been reported
to be faster than @binfile() on large files. Wink

Cheers, Mac Smile

_________________
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
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sat Apr 03, 2004 12:20 am    Post subject: Reply with quote

Can you produce the text file with one of the methods you just mentioned?
Instead of the RUN cmd DIR... I meant Smile
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


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

PostPosted: Sat Apr 03, 2004 12:26 am    Post subject: Reply with quote

You can create/edit/append/etc. files with VDSug.dll. I don't
have a @binfile() function in VDS 3x but I assume ya can
with it as well. Wink

Cheers, Mac Smile

_________________
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
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sat Apr 03, 2004 12:39 am    Post subject: Reply with quote

OK
Got all the VDSug.dll related files Smile
Who is the McLain site related to?
Nice site..

Thanks MAC
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


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

PostPosted: Sat Apr 03, 2004 12:43 am    Post subject: Reply with quote

vtol777 wrote:

Who is the McLain site related to?

Uh... me? Wink

_________________
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