| View previous topic :: View next topic |
| Author |
Message |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Apr 02, 2004 6:47 pm Post subject: 10,000 plus lines of text, too big and slow for .TXT ??? |
|
|
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 |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Apr 02, 2004 7:30 pm Post subject: |
|
|
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Apr 02, 2004 11:28 pm Post subject: |
|
|
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?
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 |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Apr 02, 2004 11:42 pm Post subject: |
|
|
naa, I knew about SORTED paramenter
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Apr 03, 2004 12:12 am Post subject: |
|
|
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.
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 |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Apr 03, 2004 12:20 am Post subject: |
|
|
Can you produce the text file with one of the methods you just mentioned?
Instead of the RUN cmd DIR... I meant  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Apr 03, 2004 12:26 am Post subject: |
|
|
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.
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 |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Apr 03, 2004 12:39 am Post subject: |
|
|
OK
Got all the VDSug.dll related files
Who is the McLain site related to?
Nice site..
Thanks MAC |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Apr 03, 2004 12:43 am Post subject: |
|
|
| vtol777 wrote: |
Who is the McLain site related to?
|
Uh... me?  _________________ 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 |
|
 |
|
|
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
|
|