| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jul 07, 2002 3:37 pm Post subject: LIST LOADFILE problem |
|
|
When I save a list with LIST SAVEFILE, it adds a blank line on to the end of the list every time. So, when I save it, I would save it like:
| Code: | --start--
data1
data2
--end-- |
but when re-opened, it displays:
| Code: | --start--
data1
data2
--end-- |
and if re-opened again, it displays:
| Code: | --start--
data1
data2
--end-- |
Any pointers would be great.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jul 07, 2002 5:37 pm Post subject: |
|
|
An example of this can be seen with this code:
| Code: |
list create,1
list loadfile,1,@path(%0)data1.txt
DIALOG CREATE,dialog,-1,0,347,200,NOMIN
DIALOG ADD,LIST,list1,22,3,340,125
DIALOG ADD,BUTTON,Add,152,4,108,24,Add
DIALOG ADD,BUTTON,Remove,152,118,110,24,Remove
DIALOG ADD,BUTTON,Close,152,234,110,24,Close
DIALOG SHOW
dialog set,list1,@text(1)
:evloop
wait event
goto @event()
:AddBUTTON
%%data = @INPUT(Enter your data:)
if %%data
if @ok()
list add,list1,%%data
goto evloop
else
goto evloop
end
goto evloop
end
goto evloop
:RemoveBUTTON
if @not(@item(list1))
warn You must select an item to remove
goto evloop
end
if @zero(@count(list1))
warn Nothing to remove
goto evloop
end
list delete,list1
goto evloop
:CloseBUTTON
:Close
list add,1,@dlgtext(list1)
list savefile,1,@path(%0)data1.txt
list close,1
%%info = @msgbox(Don't forget to run this script again to see the extra space added,VDS,$010)
exit
|
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
nick Contributor

Joined: 15 Aug 2000 Posts: 50 Location: hamburg,nj
|
Posted: Sun Jul 07, 2002 8:13 pm Post subject: |
|
|
Hello:
I think your problem is when you are adding the following line:
list add,1,@dlgtext(list1)
Good Luck,
Nick |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jul 07, 2002 10:26 pm Post subject: |
|
|
Thanks for the tip...I tried using LIST ASSIGN instead, that worked well.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 08, 2002 12:33 am Post subject: |
|
|
You can also try using
List Add,1,@text(list1)
-Garrett |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jul 08, 2002 1:30 pm Post subject: |
|
|
That also worked well, thanks Garrett.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| 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
|
|