|
Post by Rod on Jan 30, 2022 2:38:20 GMT -5
Thanks for the input metro. I will look at the code this morning, but sleeping on it another question popped into my head, daved, by any chance are you running Liberty in “compatibility mode”.
Just another thing to tick of the list. There is no need to set compatibility mode on a 64bit system since windows has a complete 32bit system included also.
If you are not sure navigate to Liberty.exe in program files x86 directory. Right click on it and look at the properties you have set.
|
|
|
Post by Rod on Jan 30, 2022 3:51:44 GMT -5
Ok like metro I find that the code runs faultlessly on my pc and renames files with or without spaces. I wonder if that rogue line has been compounding the problem. If so I am sorry for the confusion. Before we do much more remove that line from the code you posted and tell us if it runs. Three users have now said they can NAME files with or without spaces so I am hoping we have a solution. Be sure to use the code you posted, a set of code we can agree on.
I would also check that sel$<>newname$ before renaming but perhaps you have that covered.
|
|
|
Post by tenochtitlanuk on Jan 30, 2022 3:51:46 GMT -5
Just adding to the mystery, I get the same fail in Wine/LB4.5. I'd never watched the debugger before on strings with leading and trailing " characters- gets very confusing.
As a workaround that needs no dlls or exotica, I wrote a sub that works for me. Save the code in a new folder and add a file called 'long' and run the code. If you have the directory folder open you'll see the name change. For my set up anyway!! I should probably have added a 'ifFileExists' check...
nomainwin
call rename "long", "short" notice "'long' now 'short'"
call rename "short", "long" notice "'short' now 'long' again."
call rename "long", "sh ort" notice "'long' now 'sh ort''"
call rename "sh ort", "long" notice "'sh ort' now 'long' again."
wait
sub rename f1$, f2$ open f1$ for input as #fIn content$ =input$( #fIn, lof( #fIn)) close #fIn open f2$ for output as #fOut #fOut content$; close #fOut kill f1$ end sub
|
|
daved
New Member
Posts: 24
|
Post by daved on Jan 30, 2022 8:04:49 GMT -5
Metro you are correct!! Removing the line: if instr(sel$, " ") then sel$ = chr$(34)+sel$+chr$(34) solves the problem!!!! I wonder why I thought I needed to add quotes at that point. Anyway -- Thank you all for your help!!!
|
|
|
Post by Rod on Jan 30, 2022 9:31:08 GMT -5
I think we are due you an apology, we are more and more on ipads and phones trying to answer questions. I probably set you off on the quotes track. Still it is resolved. Files and paths can be a pain.
The application looked very professional, good luck with it.
|
|
daved
New Member
Posts: 24
|
Post by daved on Jan 30, 2022 11:09:32 GMT -5
Thanks for the encouragement Rod -- All your help and everyone else's is much appreciated.
|
|