Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 5th, 2024, 9:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Using variables in script pathnames
PostPosted: November 15th, 2005, 6:43 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I'm having a difficult time using a scripted pathname using a SYSTEM_DOCUMENTS_DIR in it.
The script used looks like:

OpenFile(SYSTEM_DOCUMENTS_DIR + "xyzfolder\\abcd.txt")

It won't fetch the data.

If I substitute

OpenFile("C:\\Documents and Settings\\Owner\\My Documents\\xyzfolder\\abcd.txt"), the actual current pathname, it works fine.

I wonder what I'm doing incorrectly. I'd like to get the script working using the System variable for the administrator/viewer's document directory, as different viewers can have different pathnames to it.

I would appreciate any help.

Kind Regards,
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: November 15th, 2005, 7:17 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
Should be:

OpenFile(SYSTEM_DOCUMENTS_DIR + "\\xyzfolder\\abcd.txt")

At least I've tried it that way and it works for me.

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 15th, 2005, 7:48 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

Yes, that works in this script.

However, when I use the same syntax in another, FileExists, it won't work properly:

if (FileExists (SYSTEM_DOCUMENTS_DIR "\\xyzfolder\\abcd.txt"))...etc.

This FileExist script worked perfectly when it looked like:

if (FileExists ("C:\\Documents and Settings\\Owner\\My Documents\\xyzfolder\\abcd.txt"))
{Button_8.Enable(true)
}
else
{Button_8.Enable(false)
var buttonstate="yes"
}

So now I have to solve this companion script which won't work using the System variable.

I would appreciate any ideas.

Kind Regards,
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: November 15th, 2005, 8:17 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I found the issue preventing the script from working:

forgot the +. It should be:

if (FileExists (SYSTEM_DOCUMENTS_DIR + "\\xyzfolder\\abcd.txt"))...etc.

Once corrected, it works OK.

Thanks for your help.

Kind Regards,
Stephen


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group