home *** CD-ROM | disk | FTP | other *** search
/ Backpacker 1 (Norsk) / backpacker.iso / pc / data / misc / go_all.dxr / 00040_Go_file.ls < prev    next >
Encoding:
Text File  |  1995-02-28  |  2.8 KB  |  97 lines

  1. on GotTheFileName
  2.   global F_JOBS, init, init, init, alert, alert, K5, KTQR, KTQW, UNAME, JOBS, KTKM, RRR, K6, JOBNAME, K6, JOBNAME, LIVC, CASH, TMQS, LMXQ, LQNO, DTQR, DTQW, CHN, PAY, YY, MM, DD, PPNM, PNM, LQP, J, TWNS, PSND, ACTION, EXCF, EXCF_S, goOneFile
  3.   set goOneFile to 1
  4.   set TMQS to []
  5.   set TWNS to [22, 12, 36]
  6.   set filnamn to the text of field "filnamn"
  7.   set the text of field "filnamn" to EMPTY
  8.   set filnum to 5
  9.   if char 1 of filnamn = "S" then
  10.     if char 4 of filnamn = "." then
  11.       set filnum to char 3 of filnamn
  12.     else
  13.       set filnum to char 3 to 4 of filnamn
  14.     end if
  15.     set sokvag to "@::SQ_DIR:" & filnamn
  16.   else
  17.     if char 1 of filnamn = "K" then
  18.       if char 3 of filnamn = "Q" then
  19.         set filnum to char 2 of filnamn
  20.       else
  21.         set filnum to char 2 to 3 of filnamn
  22.       end if
  23.       repeat with FN = 1 to 500
  24.         if getNthFileNameInFolder(FixPath(J, PNM & "KATDIR:KQDIR" & value(filnum) & ":"), FN) = EMPTY then
  25.           exit repeat
  26.         end if
  27.       end repeat
  28.       set KTKM to 50
  29.       set LMXQ to FN - 4
  30.       repeat with n = 1 to LMXQ
  31.         append(TMQS, n)
  32.       end repeat
  33.       append(ACTION, PutDate(J, YY, MM, DD))
  34.       append(ACTION, "K" & string(filnum))
  35.       set sokvag to "@::KATDIR:KQDIR" & filnum & ":" & filnamn
  36.     else
  37.       if char 1 of filnamn = "C" then
  38.         set sokvag to "@::CNT_DIR:" & filnamn
  39.       else
  40.         if char 1 to 3 of filnamn = "DEP" then
  41.           if char 5 of filnamn = "." then
  42.             set filnum to char 4 of filnamn
  43.           else
  44.             set filnum to char 4 to 5 of filnamn
  45.           end if
  46.           set sokvag to "@::DEP_DIR:" & filnamn
  47.         else
  48.           if char 1 of filnamn = "D" then
  49.             if char 3 of filnamn = "Q" then
  50.               set filnum to char 2 of filnamn
  51.             else
  52.               set filnum to char 2 to 3 of filnamn
  53.             end if
  54.             append(ACTION, PutDate(J, YY, MM, DD))
  55.             append(ACTION, "D" & filnum)
  56.             set TWNS to [28, 12, value(filnum)]
  57.             set sokvag to "@::DESTDIR:DQDIR" & filnum & ":" & filnamn
  58.           else
  59.             if char 1 to 3 of filnamn = "BPK" then
  60.               set sokvag to "@:" & filnamn
  61.             else
  62.               alert("File not found!")
  63.               exit
  64.             end if
  65.           end if
  66.         end if
  67.       end if
  68.     end if
  69.   end if
  70.   set PPNM to sokvag
  71.   set EXCF to getAt(EXCF_S, getLast(TWNS))
  72.   set P to getLast(TWNS)
  73.   repeat with n = 1 to LMXQ
  74.     append(TMQS, n)
  75.   end repeat
  76.   FixAnsChan(J)
  77.   set DTQR to 0
  78.   set DTQW to 0
  79.   set JOBNAME to "ACME INC"
  80.   set KTQR to 0
  81.   set KTQW to 0
  82.   set P to getLast(JOBS)
  83.   set PAY to 200
  84.   set LIVC to 100
  85.   set F_JOBS to 0
  86.   set LQP to 1
  87.   set LQNO to 0
  88.   set PSND to "SIL_PAUS.AIF"
  89.   sound stop CHN
  90.   FixAnsChan(J)
  91.   sound stop CHN
  92.   when timeOut then nothing
  93.   updateStage()
  94.   set PSND to "SIL_PAUS.AIF"
  95.   go("OUT")
  96. end
  97.