Author Topic: A strange about function "getfiled"  (Read 1958 times)

0 Members and 1 Guest are viewing this topic.

snddd2000

  • Guest
A strange about function "getfiled"
« on: January 27, 2013, 10:23:22 PM »
here a confused
At home computer ,I run (setq csvfile (getfiled  "" "" "csv" 4))
if i directly point a file,the return is right, for example "C:\\Users\\new.csv"
if I open a folder "1" under folder "Users"  then back folder "Users" point "new.csv" .
The return will be "C:\\Users\\1\\new.csv"
Office computer, everything is Ok.
Someone know why, and solve
thanks

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: A strange about function "getfiled"
« Reply #1 on: January 27, 2013, 10:59:32 PM »
the file name returned should be the file selected. If you have the same file name in both folders, the function will not automatically select the one in the current folder. using your example, if you select a file "new.csv" in folder "C:\Users\1\", then change folders to "C:\Users\" If you don't select the file "new.csv" in that folder, the location will be C:\Users\1\
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

snddd2000

  • Guest
Re: A strange about function "getfiled"
« Reply #2 on: January 28, 2013, 02:52:12 AM »
thanks keith
but  folder "1" is empty.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: A strange about function "getfiled"
« Reply #3 on: January 28, 2013, 08:20:32 AM »
Have you tried setting flags to 8 or 12? Using 4 is to allow an arbitrary file extension.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: A strange about function "getfiled"
« Reply #4 on: January 28, 2013, 08:45:15 AM »
Do you receive the same behaviour when testing with:

Code: [Select]
(getfiled "" "" "csv" 0)

snddd2000

  • Guest
Re: A strange about function "getfiled"
« Reply #5 on: January 28, 2013, 06:21:23 PM »
Yes , receive the same behaviour when testing with 0 4 8 12 128.
I have no idea. :roll:
thanks all

snddd2000

  • Guest
Re: A strange about function "getfiled"
« Reply #6 on: January 28, 2013, 08:10:50 PM »
This morning, I think again, what is the different between my computer at home and office.
Home's is single-click to open an item;
Office's is the standard double-click.
So I change office's computer to single-click in Folder Options.
Then run above code again.
So the return is same as at home, get a wrong full-name.
Have any solution about this?

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: A strange about function "getfiled"
« Reply #7 on: January 28, 2013, 08:16:39 PM »
Have any solution about this?

Change both to double-click? :P

snddd2000

  • Guest
Re: A strange about function "getfiled"
« Reply #8 on: January 28, 2013, 11:56:16 PM »
 Maybe it is the only way? 8-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

xiaxiang

  • Guest

snddd2000

  • Guest
Re: A strange about function "getfiled"
« Reply #11 on: January 29, 2013, 03:40:19 AM »
Thanks Cab and Xia
Yes, I like "MSComDlg.CommonDialog".
but GetInterfaceObject maybe better?
« Last Edit: January 29, 2013, 08:06:54 PM by snddd2000 »