PDA

View Full Version : Folder Bug?


pjborg
11-08-2003, 01:56 AM
My project creates and references folders on the user's system. I've discovered that if a folder has a one-character name, i.e. "x" AMS reads and displays this as "\x"

This is true if the folder is created by AMS or otherwise.

To find the folders I want, I've inserted a text file in each folder, and AMS looks for that specific file, then parses the path, using the "String - Parse Path" action, with the "Folder 2" option to display the last folder in the file path.

All folders with names of 2 or more characters are created and displayed correctly, and all functions work fine.

Trying to work with a folder with a 1-character name generates errors, because the program tries to look for "filepath\\x"

I don't know if I've erred somewhere, because other than this, everything works great.

Thanks.

JimS
11-08-2003, 05:16 AM
I have been able to replicate this problem. I hate to use the “B” word, but it’s not just you. I see the same problem. I came up with a quick work around. If you would like to check out my work around, download this zip file. Basically, I just check the returned path, and if the first character is a backslash, I get rid of it. I added Test 1 and Test 2 to replicate and verify this problem. Hope this helps.

pjborg
11-09-2003, 04:13 PM
Thanks very much!

I just discovered that modifying the variable with a string operator seems to work ok too, at least in my project:

%ParsedFolder% = Evaluate (%ParsedFolder% - \\)

In the future I'll be more circumspect with my use of that "B"word.

JimS
11-09-2003, 04:48 PM
Glad you got it working for you. That’s one of the things I love most with AMS, there always seems to be more than one way to do something. I guess it all depends on where your brain happens to be at the moment. Actually, when I think about it today, I should have just used the String Replace function, and replaced any backslashes with nothing, effectively removing any and all of them with a singe line of code. Like I said, it’s all about where your brain happens to be at the moment.

I’m happy that you pointed out this problem. It’s something that I have never ran into, something I never even thought about before. Now it’s something I’ll have to watch for in my own projects. Good info, thanks.