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 question
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Mon Nov 25, 2002 4:27 am    Post subject: Reply with quote

Variables can be used in just about all(maybe all?) commands.
Try:
Code:

%T = c:\test.txt
LIST LOADFILE,tim,%T

Make sure that the text file and the list named "tim" both exist though.

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 4:34 am    Post subject: i got it Reply with quote

i got the var working Smile


thanks for the help Smile
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 4:40 am    Post subject: :0 Reply with quote

i notice if you have big file playing you can't stop the program intill it is done showing the file in the text box...
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Mon Nov 25, 2002 4:45 am    Post subject: Reply with quote

Yes because you are stuck in the repeat loop until it's done with the file.
You can check for an event in the loop. Add the code below into the loop:
Code:

%%Event = @event()
IF %%Event
  goto %%Event
END

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 4:55 am    Post subject: :) Reply with quote

that worked Smile


thanks
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1567

PostPosted: Mon Nov 25, 2002 5:48 am    Post subject: Reply with quote

here is one way:

Code:

title test code
  DIALOG CREATE,test code,-1,0,199,79
  DIALOG ADD,EDIT,EDIT1,8,8,180,19
  DIALOG ADD,BUTTON,BUTTON1,36,124,64,24,Start
  DIALOG SHOW
 
  list create,1
 
  list add,1,hello world
  list add,1,@cr()
  list add,1,whats up
  list add,1,
  list add,1,not much
  list add,1,@chr(10)
  list add,1,okay this is the
  list add,1,@chr(13)
  list add,1,end
  rem use list loadfile instead of adding items above in your case
 
:evloop
  wait event
  goto @event()
 
:button1button
 %%listpos = 0
 repeat
   rem Don't use @trim if you want to preserve line-ends or other non standard chars
   %%THE_VARIABLE = @trim(@item(1,%%listpos))
   dialog set,edit1,%%THE_VARIABLE
   %%listpos = @succ(%%listpos)
   wait 1
   rem remove WAIT 1 to make the code alot faster
 until @equal(%%listpos,@count(1))
goto evloop
 
:close
 list close,1
exit
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Nov 25, 2002 8:51 am    Post subject: Reply with quote

Hi Tim,

If you want to load txt files in your script, you can also use this:

Code:

%%editname = timedit

list create,1
list loadfile,1,c:\tim.txt
%z = 0

repeat
dialog set,%%editname,@dlgtext(%%editname)@cr()@chr(10)@item(1,%z)
%z = @succ(%z)
until @equal(@pred(%z),@count(1))

list close,1


I don't know if this is exactly what you meant, and I also don't know if it is working, because I made it out of my mind (I am @ school).

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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