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 


Conditional includes not possible?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
attreus
Valued Newbie


Joined: 30 Jul 2002
Posts: 46
Location: Berlin/Germany

PostPosted: Tue Jul 08, 2008 6:39 am    Post subject: Conditional includes not possible? Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


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

PostPosted: Tue Jul 08, 2008 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message
attreus
Valued Newbie


Joined: 30 Jul 2002
Posts: 46
Location: Berlin/Germany

PostPosted: Tue Jul 08, 2008 3:10 pm    Post subject: Reply with quote

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 Confused
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Jul 08, 2008 5:30 pm    Post subject: Reply with quote

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 Confused

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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