| View previous topic :: View next topic |
| Author |
Message |
attreus Valued Newbie

Joined: 30 Jul 2002 Posts: 46 Location: Berlin/Germany
|
Posted: Tue Jul 08, 2008 6:39 am Post subject: Conditional includes not possible? |
|
|
hi,
i wanna check if a script in the same folder already exists an if so include it, if not create it.
| Code: |
if @file(test.dsc)
#INCLUDE test.dsc
else
bla bla ...
end
|
the compiler gives an error "can not open test.dsc"
any ideas? |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Jul 08, 2008 8:01 am Post subject: |
|
|
Maybe try this:
| Code: | if @greater(@file(@path(%0)test.dsc,z),0)
#INCLUDE test.dsc
else
bla bla ...
end
|
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
attreus Valued Newbie

Joined: 30 Jul 2002 Posts: 46 Location: Berlin/Germany
|
Posted: Tue Jul 08, 2008 3:10 pm Post subject: |
|
|
thank you, but still the same.
i'm afraid the preprocessor isn't able, to evaluate the condition.
hopefully i'm wrong with that.
greetings  |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Jul 08, 2008 5:30 pm Post subject: |
|
|
You cannot do conditional #INCLUDES...
#INCLUDE is a pre-compiled directive. The IF command is a compiled instruction. I have placed this in the Wish List but Jules said that he could not make that happen and did not see any reason too either
I suggest that #IF, #ELSE, #END pre-compiled directives be added to the VDS language.
Here is my original post on this subject...
http://www.vdsworld.com/forum/viewtopic.php?t=2018&highlight=directive
Thanks,
Dragonsphere |
|
| Back to top |
|
 |
|