Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid subscript reference
Message
From
30/11/2006 15:13:45
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01173721
Message ID:
01173851
Views:
11
>>>>>>>You can't use [*g*.*] as a mask. You always will get a whole folder. try even in command prompt (old DOS) window:
>>>>>>>DIR *g*.*
>>>>>>>What you want? A file that have G somewhere in the name?
>>>>>>
>>>>>>Yes, but not in the extension part. Anyway, I think I can always call this program with extension, so this problem becomes mute. But I was a bit surprised to see this behavior.
>>>>>
>>>>>But this is the usual behavior, that mask [*G*.*] is equal to [*.*], you get ALL files, no matter where you use it - ADIR(), SYS(2000), DIR, no matter what language you will use. If you know what letter must be [G] you can use [???G*.*] if the [G] is third letter.
>>>>
>>>>That's not true for ADIR. It returns files containing G before the extension, e.g. in the file part.
>>>
>>>HA! This is something new to me :-)
>>>Thank you, I learned something today.
>>>I always thing that that way works all file searching functions that allow wildcards in them.
>>>Because I had a bad experience with that from my CLIPPER days I never tried this :-)
>>
>>I have a folder with 39 files in it.
>>
>>I tried this:
>>
CLEAR
>>lcPath = "C:\testdir"
>>lcSkeleton = "*E*"
>>lcFile = SYS(2000,ADDBS(m.lcPath) + m.lcSkeleton)
>>
>>lnI = 0
>>DO WHILE NOT EMPTY(m.lcFile)
>>  m.lnI = m.lnI + 1
>>  ?m.lcFile
>>  lcFile=SYS(2000,ADDBS(m.lcPath) + m.lcSkeleton,1)
>>ENDDO
>>?m.lnI
>>
>>I got 21 files. So it is finding files with an E anywhere in the file name.
>>
>>When I changed lcSkeleton = "*E*.*"
>>
>>I got the same 21 files. The "." is ignored because 1 of the files returned by both is:
>>
>>VNC-4_1_1-X86_WIN32 with .EXE as the extension.
>
>Yes, Mike
>I realise that after I create a proper testing environment :o)
>But when I first test, I was so exited (because as I said I had a bad experience with CLIPPER) that I post my message bfore that :o)

Nothing like testing to beat opinion!
Previous
Reply
Map
View

Click here to load this message in the networking platform