Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Troi File Windows 98 vs. 2000


Fitch

This topic is 7866 days old. Please don't post here. Open a new topic instead.

Recommended Posts

My script works on Mac OS X and Win98, but not Win2000. (OS 9 not yet tested.) First I use TrFile-CreateFolder, then I use TrFile-FileSpec To FullPath and end up with a path like this: "C:WINDOWSDesktopIssue 25 Export" and the folder is created on the desktop. This works on Win98 and on 2000, the file path is different, but that's to be expected, and the folder gets created as expected.

The problem comes in the next part of the script:

Set Field [gFile, External ("TrFile-CreateFile", gPath & gName & ".txt")]

Perform Script ["TroiFile Handle error codes"]

1. Why does this script fail on Win2000? If it can create a folder, why not a file?

2. Why doesn't it return an error?

Link to comment
Share on other sites

Well, duh... never mind. I had remembered that Status(CurrentPlatform) returns 1 if the current platform is the Mac OS 9 and earlier, and -1 if the current platform is Mac OS X, or 2 if the platform is Windows 98 or Windows Me, but I forgot that it's -2 if the platform is Windows NT/2000/XP.

So I had been tacking a colon on the end of my path instead of a backslash. Of course that was the last think I thought to check...

Abs(Status (CurrentPlatform)) returns 2 for any version of Windows.

Link to comment
Share on other sites

This topic is 7866 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.