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 


LIST LOADFILE problem

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


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jul 07, 2002 3:37 pm    Post subject: LIST LOADFILE problem Reply with quote

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--


Confused
Any pointers would be great. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jul 07, 2002 5:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
nick
Contributor
Contributor


Joined: 15 Aug 2000
Posts: 50
Location: hamburg,nj

PostPosted: Sun Jul 07, 2002 8:13 pm    Post subject: Reply with quote

Hello:
I think your problem is when you are adding the following line:

list add,1,@dlgtext(list1)

Good Luck,
Nick
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jul 07, 2002 10:26 pm    Post subject: Reply with quote

Thanks for the tip...I tried using LIST ASSIGN instead, that worked well. Very Happy
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


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

PostPosted: Mon Jul 08, 2002 12:33 am    Post subject: Reply with quote

You can also try using

List Add,1,@text(list1)

-Garrett
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Jul 08, 2002 1:30 pm    Post subject: Reply with quote

That also worked well, thanks Garrett. Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
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