kaotkbliss Posted September 23, 2009 Share Posted September 23, 2009 I have some code that is something like this: $variable=0 filecopy("oldpath","newpath") if fileexists("oldpath") then $variable=1 while $variable=1 if not fileexists("newpath") then $variable=1 if fileexists("newpath") then $variable=0 wend So basically if the file doesn't exist, will it skip the loop (because $variable won't = 1)? 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
jvanegmond Posted September 23, 2009 Share Posted September 23, 2009 (edited) Why not just: filecopy("oldpath","newpath") while Not fileexists("newpath") And fileexists("oldpath") Sleep(100) wend Edited September 23, 2009 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
kaotkbliss Posted September 23, 2009 Author Share Posted September 23, 2009 well sometimes the file won't exist in the old path. (depends on how many files are created for the day) 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
jvanegmond Posted September 23, 2009 Share Posted September 23, 2009 Could you explain the requirements of this snippet in English?Example:It must wait until the old file is deleted or until the new file exists github.com/jvanegmond Link to comment Share on other sites More sharing options...
kaotkbliss Posted September 23, 2009 Author Share Posted September 23, 2009 I just need to know if a loop will be skipped if the condition is not met example: if $variable=0 and the loop is for $variable=1 the actual code is this: $kyncon1=0 $kyncon2=0 $kyncon3=0 $emailtext=WinGetText("Inbox - Microsoft Outlook", "") $string3=StringInStr($emailtext,"LKYN",0) While $string3<>0 If $string3<>0 Then FileCopy("G:\CLIENT\IDMI\GMC\PNT WFD\KYN\OMR\LKYN_"&@YEAR&@MON&@MDAY&"*.ps","C:\lkyn print\") If FileExists("G:\CLIENT\IDMI\GMC\PNT WFD\KYN\OMR\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_3.ps") Then $kyncon3=1 If FileExists("G:\CLIENT\IDMI\GMC\PNT WFD\KYN\OMR\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_2.ps") Then $kyncon2=1 If FileExists("G:\CLIENT\IDMI\GMC\PNT WFD\KYN\OMR\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_1.ps") Then $kyncon1=1 While $kyncon1=1 If Not FileExists("C:\lkyn print\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_1.ps") Then $kyncon1=1 If FileExists("C:\lkyn print\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_1.ps") Then $kyncon1=0 Sleep(100) WEnd While $kyncon2=1 If Not FileExists("C:\lkyn print\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_2.ps") Then $kyncon2=1 If FileExists("C:\lkyn print\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_2.ps") Then $kyncon2=0 Sleep(100) WEnd While $kyncon3=1 If Not FileExists("C:\lkyn print\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_3.ps") Then $kyncon3=1 If FileExists("C:\lkyn print\LKYN_"&@YEAR&@MON&@MDAY&"_ConsumerBatch_3.ps") Then $kyncon3=0 Sleep(100) WEnd 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
jvanegmond Posted September 23, 2009 Share Posted September 23, 2009 (edited) Yes.Edit: Ofcourse this is all documented in the help file. In the pages about while, and do .. until .. Actually it's documented pretty much everywhere, why is this topic here? Edited September 23, 2009 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
kaotkbliss Posted September 23, 2009 Author Share Posted September 23, 2009 I didn't recall seeing it in the help file (which I pretty much have it open when scite is open... maybe I should write a script to auto open the help file when scite is opened... lol) 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
jvanegmond Posted September 23, 2009 Share Posted September 23, 2009 There is a script for that. It runs when you press F1. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now