| View previous topic :: View next topic |
| Author |
Message |
Seffyroff Newbie

Joined: 08 Apr 2002 Posts: 15
|
Posted: Mon Apr 08, 2002 12:38 am Post subject: IF STATEMENTS AS TESTS |
|
|
Hi folks,
I'm new to VDS, and am having a few syntax problems.
I'm trying to delete a file, and test that it was successful by using an IF statement like this:
--snip--
rem delete destination world resource clm file
LIST ADD, OutputWindow, About to delete %A\resource\common\levels\%K\world\*.*
IF FILE DELETE, %A\resource\common\levels\%K\world\*.*
LIST ADD, OutputWindow, OK
else
LIST ADD, OutputWindow, couldn't delete %A\resource\common\levels\%K\world\*.*
END
--snip--
When this is run, it returns OK as true and continues, however the files haven't been deleted. What am I doing wrong? |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Mon Apr 08, 2002 1:22 am Post subject: |
|
|
You can't "nest" commands after eachother, only functions can be nested. You may be able to do what you want using the following. Usually you can use @OK() to check whether an operation worked out.
| Code: |
rem delete destination world resource clm file
LIST ADD, OutputWindow, About to delete %A\resource\common\levels\%K\world\*.*
FILE DELETE, %A\resource\common\levels\%K\world\*.*
IF @OK()
LIST ADD, OutputWindow, OK
else
LIST ADD, OutputWindow, couldn't delete %A\resource\common\levels\%K\world\*.*
END
|
Tommy |
|
| Back to top |
|
 |
Seffyroff Newbie

Joined: 08 Apr 2002 Posts: 15
|
Posted: Mon Apr 08, 2002 1:43 am Post subject: |
|
|
Tommy,
Thanks for your reply! That had solved my issues, great!
For my next question, As you may have noticed from my code i am using a list box as an output window. Is there any way to make it scroll with the updated messages automatically? at the moment when the number of messages exceeds the length of the list box they continue below the bottom of the box, and you have to manually drag the scrollbar down to see whats going on. Can it scroll down to the bottom of the box automatically somehow? |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Apr 08, 2002 7:23 pm Post subject: |
|
|
__________________________________________________________________________________________________________________________
Try this:
| Code: |
If @greater(@count(OutputWindow), 0)
LIST SEEK, OutputWindow, @pred(@count(OutputWindow))
end
|
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 |
|
 |
Seffyroff Newbie

Joined: 08 Apr 2002 Posts: 15
|
Posted: Mon Apr 08, 2002 7:27 pm Post subject: |
|
|
Thanks, Mac. That works a treat  |
|
| 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
|
|