Sign in to follow this  
Followers 0
uznut

IF STATEMENT AND COMPAIRING

5 posts in this topic

#1 ·  Posted (edited)

i confused on how to do this i need it to compair the modified date on all of these then

run a program is there a way to do this?

$Server1 = GetFileTime("S:\\AdminShare\\foxprow\\fmmc.cdx")
$Server2 = GetFileTime("S:\\AdminShare\\foxprow\\fmmctran.cdx")
$Server3 = GetFileTime("S:\\AdminShare\\foxprow\\hcb.cdx")
$Server4 = GetFileTime("S:\\AdminShare\\foxprow\\hcbtran.cdx")
$Server5 = GetFileTime("S:\\AdminShare\\foxprow\\fmmc.dbf")
$Server6 = GetFileTime("S:\\AdminShare\\foxprow\\fmmcshar.dbf")
$Server7 = GetFileTime("S:\\AdminShare\\foxprow\\fmctran.dbf")
$Server8 = GetFileTime("S:\\AdminShare\\foxprow\\hcb.dbf")
$Server9 = GetFileTime("S:\\AdminShare\\foxprow\\hcbshare.dbf")
$Server10 = GetFileTime("S:\\AdminShare\\foxprow\\hcbtran.dbf")
$PC1 = GetFileTime(C:\\FOXPROW\\Newfmmc\\fmmc.cdx)
$PC2 = GetFileTime(C:\\FOXPROW\\Newfmmc\\fmmctran.cdx)
$PC3 = GetFileTime(C:\\FOXPROW\\Newfmmc\\hcb.cdx)
$PC4 = GetFileTime(C:\\FOXPROW\\Newfmmc\\hcbtran.cdx)
$PC5 = GetFileTime(C:\\FOXPROW\\Newfmmc\\fmmc.dbf)
$PC6 = GetFileTime(C:\\FOXPROW\\Newfmmc\\fmmcshar.dbf)
$PC7 = GetFileTime(C:\\FOXPROW\\Newfmmc\\fmctran.dbf)
$PC8 = GetFileTime(C:\\FOXPROW\\Newfmmc\\hcb.dbf)
$PC9 = GetFileTime(C:\\FOXPROW\\Newfmmc\\hcbshare.dbf)
$PC10 = GetFileTime(C:\\FOXPROW\\Newfmmc\\hcbtran.cbf)
If $PC1 = $Server1 then
Edited by uznut

Share this post


Link to post
Share on other sites



ill try that but i still need to compair them all then run something

Share this post


Link to post
Share on other sites

untested ... just to give you an idea:

$rc = FileCompareDate("S:\AdminShare\foxprow\fmmc.cdx"," C:\FOXPROW\Newfmmc\fmmc.cdx" )
Select
   Case $rc = 0
      msgbox(0,"demo","File dates differ")
   Case $rc = 1
      msgbox(0,"demo","File dates are equal")
   Case $rc = -1
      msgbox(0,"demo","File1 not found")
   Case $rc = -2
      msgbox(0,"demo","File2 not found")
   Case Else
      msgbox(0,"demo","dunno")
EndSelect

Func FileCompareDate($file1,$file2)
   $F1=FileGetTime($file1)
   if @error = 1 then  Return(-1)
  ;
   $F2=FileGetTime($file2)
   if @error = 1 then  Return(-2)
  ;
   $date1 = $f1[0] & $f1[1] & $f1[2] & $f1[3] & $f1[4] & $f1[5]
   $date2 = $f2[0] & $f2[1] & $f2[2] & $f2[3] & $f2[4] & $f2[5]
   if $date1 = $date2 Then
      Return(1)
   Else
      Return(0)
   EndIf
EndFunc

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

ty yah a lot that works :D

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0