Page 1 of 1 1
Topic Options
#170382 - 2006-11-16 02:37 PM How do I "do until" a folder exists?
matthewst Offline
Getting the hang of it

Registered: 2005-01-26
Posts: 89
I was finaly able to get the HTML script to generate the proper code. Thanks everyone!!

Now on to a problem I thought I had already solved.

The HTML document is to be placed into a folder that will not always be there. It's generated by an ancient program that we still have to use. I tried using @pid but that doesn't work because the folder isn't there when the program start but is generated at a later time. I'm thinking I can have a do loop until the folder appears then execute the script. Will that work? How do I do that?
 
[Subject name modified by NTDOC due to typo]


Edited by NTDOC (2006-11-16 07:57 PM)

Top
#170383 - 2006-11-16 03:20 PM Re: How do I "do until" a floder exists?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
How about this?

Code:

Break on
;
While Exist("c:\somefolder") <> 1
Sleep 60
Loop
;
?"Folder exists."
?"Starting an other script."
Call "c:\somescript.kix"



[edit]
Made a typo. Fixed that.
[/edit]


Edited by Mart (2006-11-16 04:54 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#170384 - 2006-11-16 05:03 PM Re: How do I "do until" a floder exists?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
BTW: @PID returns the process ID of kix32 or wkix32 and not a process ID for an other application.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#170385 - 2006-11-16 05:47 PM Re: How do I "do until" a floder exists?
matthewst Offline
Getting the hang of it

Registered: 2005-01-26
Posts: 89
Got it to work like this:
Do sleep 6
Until Exist("C:\directory") <> 0

Thanks for all your help.

Top
#170386 - 2006-11-16 06:59 PM Re: How do I "do until" a floder exists?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
like this?
doesn't look any different from the original.

Top
#170387 - 2006-11-17 09:41 AM Re: How do I "do until" a floder exists?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
There are lots of ways to get you where you want to be.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#170388 - 2006-11-17 10:27 AM Re: How do I "do until" a FOLDER exists?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Like this?


Dim $Folder
$Folder = 'C:\Temp\MyTest'
Do
Sleep 1
'Waiting for creation of ' + $Folder ?
Until GetFileAttr($Folder) & 16
'The folder ' + $Folder + ' now exists' ?

Top
#170389 - 2006-11-17 10:35 AM Re: How do I "do until" a FOLDER exists?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Even beter.
This also deals with files with the same name as the folder is supposed to have.
Was thinking about doing that in my first post but I’m feeling lazy this week (thank god I'm leaving for a small vacation next week) and I’m low on silver platters


Edited by Mart (2006-11-17 10:36 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.058 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org