| View previous topic :: View next topic |
| Author |
Message |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Mon Nov 25, 2002 4:27 am Post subject: |
|
|
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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Nov 25, 2002 4:34 am Post subject: i got it |
|
|
i got the var working
thanks for the help  |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Nov 25, 2002 4:40 am Post subject: :0 |
|
|
| 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 |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Mon Nov 25, 2002 4:45 am Post subject: |
|
|
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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Nov 25, 2002 4:55 am Post subject: :) |
|
|
that worked
thanks |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1567
|
Posted: Mon Nov 25, 2002 5:48 am Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Mon Nov 25, 2002 8:51 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|