Page 1 of 1 1
Topic Options
#10549 - 2001-07-17 04:34 PM Can I make this code easier?
Anonymous
Unregistered


Hi there,

I was wondering if there is a way 2 do this easier?!
Suggestions are welcome...!

Grtx, Eric

code:

; ***********************************************************************
; ** GIS Updates
; ***********************************************************************
BREAK OFF

IF EXIST ("C:\Jdaodbms\Project") = 1 GOTO MAIN
ELSE
GOTO END
ENDIF

:MAIN
$location = "C:\Jdaodbms\Project"
$serverpath = "@LSERVER\NETLOGON\UPDATES\GIS"
$imagefile = "C:\Jdaodbms\Images"
$backupdir = "$location\Backup"

IF EXIST ("$backupdir") = 0 MD ("$backupdir") ENDIF

; **********************************************************************************
; ** Destination locations
; **********************************************************************************
$filename1a = "$location\buyu0194.frm"
$filename1b = "$location\finq0008.frm"
$filename1c = "$location\basu0060.frm"
$filename1d = "$location\basu0062.frm"
$filename1e = "$location\basu0201.frm"
$filename1f = "$location\blk_m0001.frm"
$filename1g = "$location\blk_q0001.frm"
$filename1h = "$location\blk_q0002.frm"
$filename1i = "$location\blk_u0001.frm"
$filename1j = "$location\blk_u0002.frm"
$filename1k = "$location\blk_u0003.frm"
$filename1l = "$location\bass0089.frm"
$filename1m = "$location\capq0003.frm"
$filename1n = "$imagefile\blokker1.bmp"

; **********************************************************************************
; ** Source locations
; **********************************************************************************
$filename2a = "$serverpath\buyu0194.frm"
$filename2b = "$serverpath\finq0008.frm"
$filename2c = "$serverpath\basu0060.frm"
$filename2d = "$serverpath\basu0062.frm"
$filename2e = "$serverpath\basu0201.frm"
$filename2f = "$serverpath\blk_m0001.frm"
$filename2g = "$serverpath\blk_q0001.frm"
$filename2h = "$serverpath\blk_q0002.frm"
$filename2i = "$serverpath\blk_u0001.frm"
$filename2j = "$serverpath\blk_u0002.frm"
$filename2k = "$serverpath\blk_u0003.frm"
$filename2l = "$serverpath\bass0089.frm"
$filename2m = "$serverpath\capq0003.frm"
$filename2n = "$serverpath\blokker1.bmp"


; **********************************************************************************
$result1a = GETFILETIME ($filename1a)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2a = GETFILETIME ($filename2a)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2a <> $Result1a) ; is $filename1a not the same as $filename2a
$Prompt = "Copying file... $filename2a" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1a $backupdir ; Make a backup from Original
COPY $filename2a $location ; Copy the new File
ENDIF
; **********************************************************************************
$result1b = GETFILETIME ($filename1b)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2b = GETFILETIME ($filename2b)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2b <> $Result1b)
$Prompt = "Copying file... $filename2b" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1b $backupdir
COPY $filename2b $location
ENDIF

; **********************************************************************************
$result1c = GETFILETIME ($filename1c)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2c = GETFILETIME ($filename2c)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2c <> $Result1c)
$Prompt = "Copying file... $filename2c" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1c $backupdir
COPY $filename2c $location
ENDIF

; **********************************************************************************
$result1d = GETFILETIME ($filename1d)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2d = GETFILETIME ($filename2d)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2d <> $Result1d)
$Prompt = "Copying file... $filename2d" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1d $backupdir
COPY $filename2d $location
ENDIF

; **********************************************************************************
$result1e = GETFILETIME ($filename1e)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2e = GETFILETIME ($filename2e)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2e <> $Result1e)
$Prompt = "Copying file... $filename2e" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1e $backupdir
COPY $filename2e $location
ENDIF

; **********************************************************************************
$result1f = GETFILETIME ($filename1f)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2f = GETFILETIME ($filename2f)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2f <> $Result1f)
$Prompt = "Copying file... $filename2f" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1f $backupdir
COPY $filename2f $location
ENDIF

; **********************************************************************************
$result1g = GETFILETIME ($filename1g)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2g = GETFILETIME ($filename2g)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2g <> $Result1g)
$Prompt = "Copying file... $filename2g" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1g $backupdir
COPY $filename2g $location
ENDIF

; **********************************************************************************
$result1h = GETFILETIME ($filename1h)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2h = GETFILETIME ($filename2h)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2h <> $Result1h)
$Prompt = "Copying file... $filename2h" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1h $backupdir
COPY $filename2h $location
ENDIF

; **********************************************************************************
$result1i = GETFILETIME ($filename1i)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2i = GETFILETIME ($filename2i)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2i <> $Result1i)
$Prompt = "Copying file... $filename2i" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1i $backupdir
COPY $filename2i $location
ENDIF

; **********************************************************************************
$result1j = GETFILETIME ($filename1j)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2j = GETFILETIME ($filename2j)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2j <> $Result1j)
$Prompt = "Copying file... $filename2j" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1j $backupdir
COPY $filename2j $location
ENDIF

; **********************************************************************************
$result1k = GETFILETIME ($filename1k)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2k = GETFILETIME ($filename2k)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2k <> $Result1k)
$Prompt = "Copying file... $filename2k" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1k $backupdir
COPY $filename2k $location
ENDIF

; **********************************************************************************
$result1l = GETFILETIME ($filename1l)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2l = GETFILETIME ($filename2l)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2l <> $Result1l)
$Prompt = "Copying file... $filename2l" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1l $backupdir
COPY $filename2l $location
ENDIF

; **********************************************************************************
$result1m = GETFILETIME ($filename1m)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2m = GETFILETIME ($filename2m)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2m <> $Result1m)
$Prompt = "Copying file... $filename2m" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1m $backupdir
COPY $filename2m $location
ENDIF

; **********************************************************************************
$result1n = GETFILETIME ($filename1n)
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$result2n = GETFILETIME ($filename2n)
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF

IF ($Result2n <> $Result1n)
$Prompt = "Copying file... $filename2n" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY $filename1n $backupdir
COPY $filename2n $imagefile
ELSE
$Prompt = "All your files are up to date...!"
Gosub "CENTER"
SLEEP 1
$Prompt = " "
Gosub "CENTER"
ENDIF
GOTO END

; **********************************************************************************
:CENTER

$YCordinate = 40 - ( Len ( $Prompt ) / 2 )
Color N/N
Box ( 22, 1, 24, 78, DOUBLE ) ; erase the bar
Color W/N
At ( 23, $YCordinate ) $Prompt
Sleep 1
Return
;************************************************************
:END
Return



Top
#10550 - 2001-07-18 12:48 AM Re: Can I make this code easier?
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Eric -
I will have a go at this. I recommend building an array to store values. This example uses all your data except file names (I was lazy, okay?). Check it out and see if this helps. Confirm the display portions show array values properly - you may need to substitue a variable here within the DO/UNTIL structure, something like $TmpSrc = $SrcFil[$y].

Bill

PS: Noticed logic issue - if file not on the SERVER no bypass mechanism in place, so copy attempt still made from your script and this array example.


code:

BREAK OFF
IF EXIST ("C:\Jdaodbms\Project") <> 1 RETURN ENDIF


$location = "C:\Jdaodbms\Project"
$serverpath = "@LSERVER\NETLOGON\UPDATES\GIS"
$imagefile = "C:\Jdaodbms\Images"
$backupdir = "$location\Backup"


; REM ** Create array to store values, and an increment variable to track values
DIM $DstFil[10]
DIM $SrcFil[10]
$x = 0


$DstFil[$x] = "$location\File1" $SrcFile[$x] = "$serverpath\File1" $x=$x+1
$DstFil[$x] = "$location\File2" $SrcFile[$x] = "$serverpath\File2" $x=$x+1
$DstFil[$x] = "$location\File3" $SrcFile[$x] = "$serverpath\File3" $x=$x+1
$DstFil[$x] = "$location\File4" $SrcFile[$x] = "$serverpath\File4" $x=$x+1
$DstFil[$x] = "$location\File5" $SrcFile[$x] = "$serverpath\File5" $x=$x+1
$DstFil[$x] = "$location\File6" $SrcFile[$x] = "$serverpath\File6" $x=$x+1
$DstFil[$x] = "$location\File7" $SrcFile[$x] = "$serverpath\File7" $x=$x+1
$DstFil[$x] = "$location\File8" $SrcFile[$x] = "$serverpath\File8" $x=$x+1
$DstFil[$x] = "$location\File9" $SrcFile[$x] = "$serverpath\File9" $x=$x+1
$DstFil[$x] = "$location\File10" $SrcFile[$x] = "$serverpath\File10" $x=$x+1


$y = 0


DO
$DST = GETFILETIME ($DstFil[$y])
IF (@error <> 0) $Prompt = "File not present on client: " +@serror Gosub "CENTER" ENDIF
$SRC = GETFILETIME ($SrcFil[$y])
IF (@error <> 0) $Prompt = "File not present on server: " +@serror Gosub "CENTER" ENDIF


IF ($DST <> $SRC) ; is $DstFil not the same as $SrcFil
$Prompt = "Copying file... $SrcFil[$y]" Gosub "CENTER"
$Prompt = " " Gosub "CENTER"
COPY "$DstFil[$y]" "$backupdir" ; Make a backup from Original
COPY "$SrcFil[$y]" "$location" ; Copy the new FileENDIF
ENDIF


$y=$y+1
UNTIL $x=$y


$Prompt = "All your files are up to date...!"
Gosub "CENTER"
SLEEP 1
$Prompt = " "
Gosub "CENTER"
RETURN


:CENTER
$YCordinate = 40 - ( Len ( $Prompt ) / 2 )
Color N/N
Box ( 22, 1, 24, 78, DOUBLE ) ; erase the bar
Color W/NAt ( 23, $YCordinate )
$PromptSleep 1
Return


[ 18 July 2001: Message edited by: bleonard ]

Top
#10551 - 2001-07-18 04:08 AM Re: Can I make this code easier?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We have restyle your program. First some remarks:

  • we try to use no goto statements. positive for readability.
  • we are using DIM statement to create local variables.
  • we create an array with filenames and a WHILE..LOOP structure.
  • your end message "All your files are up to date...!" doesn't
    mean, that the files were updated correctly. we introduce a $errors
    variable.
  • we add the /H to your copy command.
  • we eliminate variables which are used only once.

Our idea:

code:

; **************************************************************************
; ** GIS Updates
; **************************************************************************
CLS
BREAK OFF
IF (Exist("C:\Jdaodbms\Project") = 1)
GOSUB main_update_files
ENDIF
RETURN ; - exit script -
:main_update_files
DIM $location, $serverpath, $imagefile, $backupdir
$location="C:\Jdaodbms\Project"
$serverpath="@LSERVER\NETLOGON\UPDATES\GIS"
$imagefile="C:\Jdaodbms\Images"
$backupdir="$location\Backup"
IF (Exist("$backupdir") = 0)
MD "$backupdir"
ENDIF
DIM $number_of_files
$number_of_files=14
DIM $errors
$errors=0
; **************************************************************************
; ** Destination locations
; **************************************************************************
DIM $source_file[$number_of_files+1]
$source_file[ 1]="$location\buyu0194.frm"
$source_file[ 2]="$location\finq0008.frm"
$source_file[ 3]="$location\basu0060.frm"
$source_file[ 4]="$location\basu0062.frm"
$source_file[ 5]="$location\basu0201.frm"
$source_file[ 6]="$location\blk_m0001.frm"
$source_file[ 7]="$location\blk_q0001.frm"
$source_file[ 8]="$location\blk_q0002.frm"
$source_file[ 9]="$location\blk_u0001.frm"
$source_file[10]="$location\blk_u0002.frm"
$source_file[11]="$location\blk_u0003.frm"
$source_file[12]="$location\bass0089.frm"
$source_file[13]="$location\capq0003.frm"
$source_file[14]="$imagefile\blokker1.bmp"
; **************************************************************************
; ** Source locations
; **************************************************************************
DIM $dest_file[$number_of_files+1]
$dest_file[ 1]="$serverpath\buyu0194.frm"
$dest_file[ 2]="$serverpath\finq0008.frm"
$dest_file[ 3]="$serverpath\basu0060.frm"
$dest_file[ 4]="$serverpath\basu0062.frm"
$dest_file[ 5]="$serverpath\basu0201.frm"
$dest_file[ 6]="$serverpath\blk_m0001.frm"
$dest_file[ 7]="$serverpath\blk_q0001.frm"
$dest_file[ 8]="$serverpath\blk_q0002.frm"
$dest_file[ 9]="$serverpath\blk_u0001.frm"
$dest_file[10]="$serverpath\blk_u0002.frm"
$dest_file[11]="$serverpath\blk_u0003.frm"
$dest_file[12]="$serverpath\bass0089.frm"
$dest_file[13]="$serverpath\capq0003.frm"
$dest_file[14]="$serverpath\blokker1.bmp"
; **************************************************************************
DIM $i
$i=1
WHILE ($i <= $number_of_files)
GOSUB update_files
$i=$i+1
LOOP
IF ($errors = 0)
$prompt="All your files are up to date...!"
ELSE
$prompt="All your files are up to date! "+$errors+" errors found."
ENDIF
GOSUB center
SLEEP 1
$prompt=" "
GOSUB center
CLS
RETURN
; **************************************************************************
:update_files
IF (Exist($source_file[$i]) = 0)
$errors=$errors+1
$prompt="File '"+LCASE($source_file[$i])+"' not present on client."
GOSUB center
ENDIF
IF (Exist($dest_file[$i]) = 0)
$errors=$errors+1
$prompt="File '"+LCASE($dest_file[$i])+"' not present on server."
GOSUB center
ENDIF
IF (GetFileTime($source_file[$i]) <> GetFileTime($dest_file[$i])) ; $source_file[$i] not the same as $dest_file[$i]?
$prompt="Copying file... $dest_file[$i]"
GOSUB center
$prompt=" "
GOSUB center
COPY $source_file_a $backupdir /H ; - make a backup from original -
COPY $dest_file_a $location /H ; - copy the new file -
ENDIF
RETURN
; **************************************************************************
:center
COLOR n/n
Box (22,1,24,78,double) ; erase the bar
COLOR w/n
At (23,40-(Len($prompt)/2)) $prompt
SLEEP 1
RETURN
; **************************************************************************


Greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#10552 - 2001-07-19 12:00 AM Re: Can I make this code easier?
Anonymous
Unregistered


Great work done guys!

...because I'm lazy too... I didn't have time to start testing Bleonard's script yet.

I worked around with MCA's script, but I can't get the "Copying file... $dest_file[1]" to work.
I think the script can't read its value. Maybe it's related to the problem that the script doesn't copy any files to the backup/source directory...

I'd be grateful if you can take a look at these 2 problems. Your script is a little bit too advanced for me...

T.i.a.
Grtx, Eric

Top
#10553 - 2001-07-19 12:32 AM Re: Can I make this code easier?
Anonymous
Unregistered


Dear,

I'm trying to implement this great script of bleonard/MCA to update some files of my own, but couldn't get it to work eighter.
Let me know if you'll get it right.

Greetz, Kira

Top
#10554 - 2001-07-19 04:04 AM Re: Can I make this code easier?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Thanks for your feedback.
We saw the problems:

  • $prompt="Copying file... $source_file[$i]" will only interpretate
    the variable $i. Array can't be evaluated in a string.
    We replace it with:
    $prompt="Copying file from... "+$source_file[$i]
  • second problem was: we hasn't modify your previous name.
    it becomes now:
    code:

    COPY $dest_file[$i] $backupdir /H ; - make a backup from original -
    COPY $source_file[$i] $dest_file[$i] /H ; - copy the new file -


btw:
- we have switch $dest_file and $source_file for readability.
- to check your feedback you have create a directory with contents.

New code:

code:

; **************************************************************************
; ** GIS Updates
; **************************************************************************
CLS
BREAK OFF
;IF (Exist("C:\Jdaodbms\Project") = 1)
IF (Exist("C:\zx1") = 1)
GOSUB main_update_files
ENDIF
RETURN ; - exit script -
:main_update_files
DIM $location, $serverpath, $imagefile, $backupdir
; - source location -
;$serverpath=@lserver+"\netlogon\updates\gis"
$serverpath="c:\zx1"
; - destination locations -
$location="C:\Jdaodbms\Project"
$location="c:\zx2"
;$imagefile="C:\Jdaodbms\Images"
$imagefile="c:\zx2"
$backupdir="$location\Backup"
IF (Exist("$backupdir") = 0)
MD "$backupdir"
ENDIF
;
DIM $number_of_files
$number_of_files=14
DIM $errors
$errors=0
; **************************************************************************
; ** Destination locations
; **************************************************************************
DIM $dest_file[$number_of_files+1]
$dest_file[ 1]="$location\buyu0194.frm"
$dest_file[ 2]="$location\finq0008.frm"
$dest_file[ 3]="$location\basu0060.frm"
$dest_file[ 4]="$location\basu0062.frm"
$dest_file[ 5]="$location\basu0201.frm"
$dest_file[ 6]="$location\blk_m0001.frm"
$dest_file[ 7]="$location\blk_q0001.frm"
$dest_file[ 8]="$location\blk_q0002.frm"
$dest_file[ 9]="$location\blk_u0001.frm"
$dest_file[10]="$location\blk_u0002.frm"
$dest_file[11]="$location\blk_u0003.frm"
$dest_file[12]="$location\bass0089.frm"
$dest_file[13]="$location\capq0003.frm"
$dest_file[14]="$imagefile\blokker1.bmp"
; **************************************************************************
; ** Source locations
; **************************************************************************
DIM $source_file[$number_of_files+1]
$source_file[ 1]="$serverpath\buyu0194.frm"
$source_file[ 2]="$serverpath\finq0008.frm"
$source_file[ 3]="$serverpath\basu0060.frm"
$source_file[ 4]="$serverpath\basu0062.frm"
$source_file[ 5]="$serverpath\basu0201.frm"
$source_file[ 6]="$serverpath\blk_m0001.frm"
$source_file[ 7]="$serverpath\blk_q0001.frm"
$source_file[ 8]="$serverpath\blk_q0002.frm"
$source_file[ 9]="$serverpath\blk_u0001.frm"
$source_file[10]="$serverpath\blk_u0002.frm"
$source_file[11]="$serverpath\blk_u0003.frm"
$source_file[12]="$serverpath\bass0089.frm"
$source_file[13]="$serverpath\capq0003.frm"
$source_file[14]="$serverpath\blokker1.bmp"
; **************************************************************************
DIM $i
$i=1
WHILE ($i <= $number_of_files)
GOSUB update_files
$i=$i+1
LOOP
IF ($errors = 0)
$prompt="All your files are up to date...!"
ELSE
$prompt="All your files are up to date! "+$errors+" errors found."
ENDIF
GOSUB center
SLEEP 1
$prompt=" "
GOSUB center
CLS
RETURN
; **************************************************************************
:update_files
IF (Exist($dest_file[$i]) = 0)
$errors=$errors+1
$prompt="File '"+LCASE($dest_file[$i])+"' not present on client."
GOSUB center
ENDIF
IF (Exist($source_file[$i]) = 0)
$errors=$errors+1
$prompt="File '"+LCASE($source_file[$i])+"' not present on server."
GOSUB center
ENDIF
IF (GetFileTime($dest_file[$i]) <> GetFileTime($source_file[$i])) ; $dest_file[$i] not the same as $source_file[$i]?
$prompt="Copying file from... "+$source_file[$i]
GOSUB center
$prompt=" "
GOSUB center
COPY $dest_file[$i] $backupdir /H ; - make a backup from original -
COPY $source_file[$i] $dest_file[$i] /H ; - copy the new file -
ENDIF
RETURN
; **************************************************************************
:center
COLOR n/n
Box (22,1,24,78,double) ; erase the bar
COLOR w/n
At (23,40-(Len($prompt)/2)) $prompt
SLEEP 1
RETURN
; **************************************************************************


Greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#10555 - 2001-07-19 04:06 AM Re: Can I make this code easier?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Kira,

The real problem in the first version were the lines

code:

COPY $source_file_a $backupdir /H ; - make a backup from original -
COPY $dest_file_a $location /H ; - copy the new file -


It were using the old variable names. Yet, it should like you will expected.
Greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.055 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