Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently November 6th, 2024, 8:41 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Variables at the end of a path
PostPosted: July 30th, 2007, 10:45 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi,

I need to check if a file exists, if not, I want to refer to the text in another file.

My problem is that my file is refered to by variables at the middle and end of the path. In all examples that I have found on this website, the variables seem to be at the begining of the path.

My pathname looks like this:

C:\MyApp\<Student_ID>\Q<L01>.txt

In this example:
C:\MyApp is the initial pathname
<Student_ID> is a folder based on the users ID
Q is a standard letter in front of the variable <L01> to form a text filename. ie QLab.txt, QLac.txt ,etc. This is used to differentiate it from another text file based on the same variable, with an "X" prefix. i.e. XLab.txt, XLac.txt, etc.

If typed in, and if this was not reliant on variables, the final path would look like:
C:\MyApp\Joe_Soap\QLab.txt

How do I insert this path into a "FileExists" Opusscript?

Regards

Neil :roll:

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


Top
 Profile  
 
 Post subject:
PostPosted: July 31st, 2007, 7:36 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Morning Nitro,

Hope this helps.

STUDID = 12345
FILEID = 'LAB'

if (FileExists("C:\\TEMP\\" +STUDID+"\\Q"+FILEID+".txt"))
{
Debug.trace("YEP IT'S HERE")
} else Debug.trace("SORRY NO FILE")

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Thanks
PostPosted: July 31st, 2007, 9:21 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi Mack,

Thanks, it worked like a dream.
I appreciate your help.

Regards
Neil :D

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group