|
I hope someone can help me. I have looked all over the BB but could not find what I am looking for. What I am trying to do is get a group of files in a directory and put the file name in a variable and then choose the variable to restore the file. I can get the list of files just fine, my problem is that some of the files are long and time is important. So what I wanted to do was as I was reading the lines out of the text file to create a variable on the fly to put the name of the file into. This way I can use a 1, 2, 3, etc as the names of the variable and that would be all the user would have to type.
code **************************************** cls ? ? ? ? ? "Enter The Hour You Want To Restore (ie. 1000, 1100, 1200, 1300, 1400, etc): " gets $selecthour $trimhour = left("$selecthour", 2)
$datalocation = "s:\vcare4x2" $filelocation = "\backup\database\hour\" $searchlocation = "$datalocation" + "$filelocation" $Filenum = 1 $filename = "*." + "$trimhour"
; temp file $tmpfile = "c:\results.txt"
; write to file. CD "$searchlocation" SHELL "%comspec% /c dir /b $filename > $tmpfile"
; read results. OPEN(1,$tmpfile,2) $string = READLINE(1) WHILE @ERROR = 0
; split the result in path and filename. $path = "" $file = $string ;? $file If $string = "" goto finish Else ?"$filenum" + ") " + "$string" Endif
WHILE INSTR($file,"\") $path = $path + SUBSTR($file,1,INSTR($file,"\")) $file = SUBSTR($file,INSTR($file,"\")+1,LEN($file)) LOOP $string = READLINE(1) $filenum = $filenum + 1 $filemessage = $filemessage + $filenum
LOOP CLOSE(1) goto getdata
:getdata $select = messagebox("Please Choose A Number of The Data File You Want To Restore", "Data File To Restore", 65569) ?"Enter Number: " gets $number
:finish
DEL $tmpfile ***************************************
Thanks for the help
|