Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello again,
I'm making a load that checks if there are any qvds in the my project folder using the QvdCreateTime function, but it doesn't let me use a path that contains '*' in it. My test goes like this:
IF IsNull(QvdCreateTime('D:\ProjectFolder\QVD\*.QVD')) = -1 THEN...
Is that any way to make it work? Or any other that solves better this problem?
Try something like
Let vQVDExists = 0;
For Each vFile in FileList ('D:\ProjectFolder\QVD\*.QVD')
Let vQVDExists = 1;
Next vFile
If vQVDExists = 1 THEN ...
Try something like
Let vQVDExists = 0;
For Each vFile in FileList ('D:\ProjectFolder\QVD\*.QVD')
Let vQVDExists = 1;
Next vFile
If vQVDExists = 1 THEN ...
Thank you, that works.
I don't know if I'm doing it wrong but, once vFile is filled, even if I erase all the qvds in the folder it still finds the same one every time unless I change the name of the variable... And reopening the application doesn't clean the variable either... Have you seen this before?
Not sure I fully understand, Moises, are you saying that you vQVDExists = 1 also when there are no QVD files?
Or are you just saying, that the vFile variable keeps stating the last found file name?
I think latter is what I would expect.
Exactly, the variable vQVDExists keeps receiving 1 whether or not there are files in the folder, except for the first time the script is reloaded, when it works well and vQVDExists returns 0, once the vFile is "used" one time, it always return the same qvd file found in the first reload, existing or not in the folder.
Sorry for my english, I'm from Brazil and maybe I'm still thinking in portuguese grammar when writing...
Moises,
I have tested the code on QV12 IR and QV11.20 SR11 (both X64) using something like
Let vQVDExists = 0;
For Each vFile in FileList ('E:\Users\Stefan\Downloads\*.QVD')
Let vQVDExists = 1;
Next vFile
If vQVDExists = 1 THEN
TRACE Yep, QVDs found!;
ENDIF
TRACE $(vFile);
QVDs were found and I got the TRACE output. Then I changed the search pattern to 'E:\Users\Stefan\Downloads\*.aaQVD'
and the TRACE output for found QVD is now missing. In both cases, the same vFile variable value will be shown (that's what I expect).
So I can't reproduce what you are observing.
On which version are you?
Can you post a sample QVW, so I can run your code?
Regards,
Stefan
Hello there, I don't know if was something stuck on cache (if it has a cache for variables like that), but the bug kind of gone today when I got back to it... I ran some tests again and it went ok... So thank you again for the attention. Problem solved. =]