home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / pc / Software / VirtualA / 32bit / vasetup.exe / %MYDIR% / ENS.EBS < prev    next >
Encoding:
Text File  |  1999-10-06  |  18.3 KB  |  675 lines

  1. 'T:ENS.EBS for CompuServe
  2. ' VA 4.52 release
  3.  
  4. Global Const IM_DELETE    = 2048
  5.  
  6. Declare Function UniqueFileName$
  7. Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
  8. Declare Sub ReportSuccess(id As String)
  9. Declare Function StartCapture(pseudo As String)
  10. Declare Function GoForum(ByVal forum As String) As Boolean
  11. Declare Sub SendCR(t As Tracker)
  12. Declare Function ParseString(args As String, delim As String) As String
  13.  
  14. 'T:LongName (subroutine) (CompuServe)
  15. ' Converts short source name to long name
  16. Function LongName(s As String) As String
  17.     Select Case Trim$(UCase$(s))
  18.     Case "APN"
  19.         LongName = "AP_US_&_World"
  20.     Case "APS"
  21.         LongName = "AP_Sports"
  22.     Case "APF"
  23.         LongName = "AP_Financial"
  24.     Case "RTW"
  25.         LongName = "Reuters_World_Report"
  26.     Case "RTNA"
  27.         LongName = "Reuters_North_America"
  28.     Case "RTS"
  29.         LongName = "Reuters_Sports_Report"
  30.     Case "RTF"
  31.         LongName = "Reuters_Financial_Report"
  32.     Case "RTVE"
  33.         LongName = "Reuters_Variety_Entertainment"
  34.     Case "RTCE"
  35.         LongName = "Reuters_Euro_Community_Report"
  36.     Case "RTEC"
  37.         LongName = "Reuters_Euro_Community_Report"
  38.     Case "DPA"
  39.         LongName = "Deutsche_Presse-Agentur"
  40.     Case "UPN"
  41.         LongName = "UPI_US_&_World"
  42.     Case "UPS"
  43.         LongName = "UPI_Sports"
  44.     Case "UPF"
  45.         LongName = "UPI_Financial"
  46.     Case "UPSE"
  47.         LongName = "UPI_Southeast_US"
  48.     Case "UPNE"
  49.         LongName = "UPI_Northeast_US"
  50.     Case "UPCE"
  51.         LongName = "UPI_Central_US"
  52.     Case "UPSW"
  53.         LongName = "UPI_Southwest_US"
  54.     Case "UPMA"
  55.         LongName = "UPI_Mid-Atlantic_US"
  56.     Case "UPWE"
  57.         LongName = "UPI_Western_US"
  58.     Case "OTC"
  59.         LongName = "OTC_NewsAlert"
  60.     Case "WP"
  61.         LongName = "Washington_Post"
  62.     Case "DJ"
  63.         LongName = "Dow_Jones_News"
  64.     Case "PR"
  65.         LongName = "PR_News"
  66.     Case "PA"
  67.         LongName = "PA_News"
  68.     Case "AAP"
  69.         LongName = "Australian_Associated_Press"
  70.     Case "APO"
  71.         LongName = "AP_Online_News"
  72.     Case "FAP"
  73.         LongName = "AP_France_News"
  74.     Case "BW"
  75.         LongName = "Business_Wire_News"
  76.     Case "CN"
  77.         LongName = "COMTEX_Newswire_News"
  78.     Case "RTOS"
  79.         LongName = "Reuters_Online_Service_News"
  80.     Case "RTBR"
  81.         LongName = "Reuters_Business_Report_News"
  82.     Case Else
  83.         LongName = "*Unknown*"
  84.     End Select
  85. End Function
  86.  
  87. 'T:Send2 (subroutine) (global)
  88. 'Sends a "2" to the service
  89. Sub Send2(t As Tracker)
  90.     Comms.Send "2\r"
  91.     t.reset
  92. End Sub
  93.  
  94. 'T:StripCapture (subroutine) (global)
  95. 'Removes from capture file
  96. Sub StripCapture(t As Tracker)
  97.     CaptureRewind Len(t.match)
  98.     t.reset
  99. End Sub
  100.  
  101. 'T:StripCapture1 (subroutine) (global)
  102. 'Removes the last single character from capture file
  103. Sub StripCapture1(t As Tracker)
  104.     CaptureRewind 1
  105.     t.reset
  106. End Sub
  107.  
  108. 'T:ProcessENSFile (subroutine) (global)
  109. Sub ProcessENSFile(filename As String)
  110.     Dim inpline As String, src As String, tmpfile As String
  111.  
  112.     On Error Goto File_error
  113.     Open filename For Input Access Read Shared As #1
  114.     tmpfile = UniqueFilename$()
  115.     Open tmpfile For Output Access Write Shared As #5
  116.     Print #5, "Processed ENS report file"
  117.     Do Until Eof(1)
  118.         Line Input #1, inpline
  119.         If Mid$(inpline, 1, 11)="!start ens/" Then
  120.             Print #5, inpline;
  121.             Do Until Eof(1)
  122.                 Line Input #1, inpline
  123.                 If InStr(inpline, "/") Then
  124.                     src = Mid$(inpline, 1, InStr(inpline, "/")-3)
  125.                     Print #5, " "+LongName$(src)
  126.                     inpline = Mid$(inpline, InStr(inpline, "/"))
  127.                     If InStr(inpline, "  ") Then
  128.                         inpline = LCase$(Trim$(Mid$(inpline, InStr(inpline, "  ")+2)))
  129.                         Mid$(inpline, 1, 1) = UCase$(Mid$(inpline, 1, 1))
  130.                         Print #5, inpline
  131.                     End If
  132.                     Exit Do
  133.                 End If
  134.             Loop
  135.         Else
  136.             Print #5, inpline
  137.         End If
  138.     Loop
  139. File_nofile:
  140.     On Error Goto 0
  141.     Close #1
  142.     Close #5
  143.     DeleteFile filename
  144.     On Error Resume Next
  145.     Name tmpfile As filename
  146.     On Error Goto 0
  147.     Exit Sub
  148. File_error:
  149.     Resume File_nofile
  150. End Sub
  151.  
  152.  
  153. 'T:GetENSFolder (subroutine) (CompuServe)
  154. Sub GetENSFolder(id As String, folder As String)
  155.     Dim t As Tracker, err1 As Tracker, err2 As Tracker, strip1 As Tracker
  156.     Dim filename As String
  157.     Dim story As Integer
  158.     Dim MoreStories As Boolean, NoStories As Boolean
  159.     Dim ok As Boolean
  160.  
  161.     NoStories = False
  162.     Do
  163.         ' Go to main page
  164.         If Not GoForum("cis:ens") Then
  165.             LogResult "Failed trying to GO ENS"
  166.             Exit Sub
  167.         End If
  168.         ResetForum
  169.         Comms.Send "set lines 0\r"
  170.         WaitForPrompt "Prompt"
  171.  
  172.         ' Only get the first 70 for the late news - don't cycle forever
  173.         If folder="Late" Then
  174.             MoreStories = False
  175.         Else
  176.             MoreStories = True
  177.         End If
  178.  
  179.         ' Start capturing
  180.         filename = UniqueFilename$()
  181.         Capture CAPTURE_ON, filename
  182.         Set err1 = CreateTracker("PromptMainNoFolder1", "\n? Unknown command '", "", True)
  183.         Set err2 = CreateTracker("PromptMainNoFolder2", "\n% No stories selected", "", True)
  184.         Set strip1 = CreateTracker("Strip1", "\nExecutive News Svc.($)", "StripCapture", True)
  185.         Terminal.CaptureStatus CAPTURE_ON
  186.  
  187.         ' Get all messages
  188.         Comms.Send "scan "+Mid$(folder,1,10)+"\r"
  189.         WaitForPrompt "PromptMain"
  190.         err1.delete
  191.         err2.delete
  192.         If PromptMatches("PromptMainNoFolder") Then
  193.             CaptureText Basic.Eoln$+"!start ens/"+folder+" CompuServe"+Basic.Eoln$
  194.             If PromptMatches("PromptMainNoFolder1") Then
  195.                 CaptureText "No such folder."+Basic.Eoln$
  196.                 CaptureText "Perhaps you mistyped it or the folder has expired."+Basic.Eoln$
  197.             Else
  198.                 CaptureText "Folder contains no stories."+Basic.Eoln$
  199.             End If
  200.             CaptureText "!end"+Basic.Eoln$
  201.             MoreStories = False
  202.             NoStories = True
  203.         Else
  204.             Terminal.Enabled=False
  205.             For story = 1 To 70
  206.                 Set err1 = CreateTracker("PromptMainNoMore1", "\n"+Str$(story)+" is an invalid choice!")
  207.                 Set err2 = CreateTracker("PromptMainNoMore2", "\n "+LTrim$(Str$(story))+" is an invalid choice!")
  208.                 Comms.Send Str$(story)+"\r"
  209.                 WaitFor "\r"
  210.                 CaptureText Basic.Eoln$+"!start ens/"+folder+Basic.Eoln$
  211.                 WaitForPrompt "PromptMain"
  212.                 CaptureRewind 1
  213.                 err1.delete
  214.                 err2.delete
  215.                 CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  216.                 If PromptMatches("PromptMainNoMore") Then
  217.                     CaptureRewind 21+Len(Str$(story))
  218.                     MoreStories = False
  219.                     Exit For
  220.                 End If
  221.                 Terminal.CaptureStatus story, "Received Story"
  222.             Next
  223.             Terminal.Enabled=True
  224.         End If
  225.         Terminal.CaptureStatus CAPTURE_OFF
  226.  
  227.         ' Clean up
  228.         strip1.delete
  229.         Capture CAPTURE_OFF
  230.  
  231.         ' Process file
  232.         If Not NoStories Then ProcessENSFile filename
  233.  
  234.         ' Add to import queue
  235.         If QueueFile(Session.Service, filename, IM_DELETE) Then
  236.             ok = True
  237.         End If
  238.  
  239.         ' Delete any read stories
  240.         Set t = CreateTracker("PromptStories", "Enter <CR> to retain stories !", "Send2")
  241.         GoTop
  242.         t.delete
  243.     Loop While MoreStories=True
  244.     If ok Then
  245.         ReportSuccess id & " : Get ENS Folder " & folder
  246.     End If
  247. End Sub
  248.  
  249.  
  250. 'T:DeleteENSFolder (subroutine) (CompuServe)
  251. Sub DeleteENSFolder(id As String, folder As String)
  252.     Dim t As Tracker
  253.  
  254.     ' Go to main page
  255.     If Not GoForum("cis:ens") Then
  256.         LogResult "Failed trying to GO ENS"
  257.         Exit Sub
  258.     End If
  259.     Comms.Send "set lines 0\r"
  260.     WaitForPrompt "Prompt"
  261.  
  262.     ' Delete
  263.     Terminal.status "Deleting Folder: " +folder
  264.     Set t = CreateTracker("PromptError", "\n\?* is not a folder", "", False, True)
  265.     Comms.Send "delete "+Mid$(folder,1,10)+"\r"
  266.     WaitForPrompt "Prompt"
  267.     If PromptMatches("PromptError") Then
  268.         WaitFor "!"
  269.         LogResult "Unable to delete ENS folder "+folder
  270.     Else
  271.         WriteENSFolder folder, True
  272.         LogResult folder+ " deleted."
  273.     End If
  274.     
  275.     ' Clean up
  276.     t.delete
  277.     GoTop
  278.     ReportSuccess id & " : Delete ENS Folder " & folder
  279. End Sub
  280.  
  281. 'T:CreateENSFolder (subroutine) (CompuServe)
  282. Sub CreateENSFolder(id As String, folder As String, expires As String, _
  283.                     retain As String, keyphrase As String, AP As String, _
  284.                     UPI As String, Reuters As String, AllOthers As String)
  285.  
  286.     Dim t As Tracker, t2 As Tracker, t3 As Tracker, t4 As Tracker, t5 As Tracker
  287.     Dim APYes As String, UPIYes As String, ReutersYes As String
  288.     Dim AllOthersYes As String
  289.     Dim PressCR as Tracker
  290.     Dim i As Integer, key(1 To 7) As String
  291.     Dim tDate As Tracker, tRetain As Tracker, tWires As Tracker
  292.  
  293.     ' Go to main page
  294.     If Not GoForum("cis:ens") Then
  295.         LogResult "Failed trying to GO ENS"
  296.         Exit Sub
  297.     End If
  298.     Comms.Send "set lines 0\r"
  299.     WaitForPrompt "Prompt"
  300.  
  301.     ' just to be sure we're at the main page
  302.     Set PressCR = CreateTracker("GoPressCR2", "\nPress <CR> to continue :", "SendCR") ' temp fix to get round washington post problem
  303.     Comms.Send "go cis:ens\r"
  304.     WaitForPrompt "Prompt"
  305.     PressCR.Delete
  306.  
  307.     Terminal.Enabled=False
  308.     Terminal.Status "Creating ENS Folder: "+folder+" ..."
  309.  
  310.     'If folder has a <space>, just use the first word, cuz' CIS will
  311.     If (InStr(folder, Chr$(32))) Then
  312.         folder = Left$(folder, InStr(folder, Chr$(32)))
  313.     End If
  314.     
  315.     Set t = CreateTracker("PromptError", "\n\?* is already a folder", "", False, True)
  316.     Set t2 = CreateTracker("PromptError2", "\n\% No more Clipping Folders may be created")
  317.     Set t3 = CreateTracker("PromptDate", "Expiration Date (MM/DD/YY) :")
  318.     Set t4 = CreateTracker("PromptInput", "\n* :", "", False, True)
  319.     Set t5 = CreateTracker("PromptInput2", "\n:")
  320.     Set tWires = CreateTracker("PromptWires", "Enter choice or <CR> for more wires !")
  321.  
  322.     APYes = "1,2,3,4,5,"
  323.     AllOthersYes = "6,7,8,9,10,11,12,"
  324.     ReutersYes = "13,14,15,16,17,18,19,"
  325.     UPIYes = "20,21,22,23,24,25,26,27,28,"
  326.  
  327.     'Let's do it
  328.     Comms.Send "create "+Mid$(folder,1,10)+ "\r"
  329.  
  330.     WaitForPrompt "Prompt"
  331.  
  332.     If PromptMatches("PromptError") Then
  333.         WaitFor "!"
  334.         LogResult "Unable to Create ENS folder "+folder
  335.         Goto Cleanup
  336.     End If
  337.  
  338.     ' Check date, set default if invalid and tell user
  339.     ' moved this Tracker down here because I had to reduce it to a '?' to 
  340.     '    catch the error and I didn't want it catching anything else
  341.     Set tDate = CreateTracker("BadDate", "\?")
  342.     Terminal.Status "Setting expiration date..."
  343.     Comms.Send expires + "\r"
  344.     WaitForPrompt "Prompt"
  345.     If tDate.found Then
  346.         Comms.Send "\r"
  347.         LogResult "Invalid date.  Default date used."
  348.         WaitForPrompt "Prompt"
  349.     End If
  350.     tDate.delete
  351.  
  352.     ' Check #, set default if invalid and tell user
  353.     ' Can't get tRetain to work with anything!
  354.     Set tRetain = CreateTracker("BadDays", "%")
  355.     Terminal.Status "Setting story retain days..."
  356.     Comms.Send retain + "\r"
  357.     WaitForPrompt "Prompt"
  358.     If tRetain.found Then
  359.         Comms.Send "\r"
  360.         WaitForPrompt "Prompt"
  361.         LogResult "Invalid retain days.  Default days used."
  362.     End If
  363.     tRetain.delete
  364.     
  365.     'Which wires do we want
  366.     Terminal.Status "Setting Newswires to scan..."
  367.     If Not PromptMatches("PromptWires") Then
  368.         LogResult "Bail out, something went wrong with the dates or days."
  369.         Exit Sub
  370.     End If
  371.  
  372.     CountWires% = 0
  373.     
  374.     If AP = "y" Then
  375.         Comms.Send APYes
  376.         CountWires = CountWires + 1
  377.     End If
  378.  
  379.     If AllOthers = "y" Then
  380.         Comms.Send AllOthersYes
  381.         CountWires = CountWires + 1
  382.     End If
  383.  
  384.     If Reuters = "y" Then
  385.         Comms.Send ReutersYes
  386.         CountWires = CountWires + 1
  387.     End If
  388.  
  389.     If UPI = "y" Then
  390.         Comms.Send UPIYes
  391.         CountWires = CountWires + 1
  392.     End If
  393.  
  394.     If CountWires = 0 Then
  395.         Comms.Send "All"
  396.         LogResult "No Newswires were specified for " +folder+  ".  Defaulted to All Newswires"
  397.     End If
  398.     
  399.     Comms.Send "\r"
  400.     WaitFor "Enter choice or <CR> for more wires !"
  401.     Comms.Send "\r"
  402.     WaitFor "Enter choice or <CR> to continue !"
  403.     
  404.     ' check for semi-colons and parse into separate keyphrases
  405.     If InStr(keyphrase, Chr$(59)) Then
  406.         i=1
  407.         Do While InStr(keyphrase, Chr$(59))
  408.             key(i) = ParseString(keyphrase, ";")
  409.             key(i) = LTrim$(key(i))
  410.             If i=7 Then
  411.                 Exit Do
  412.             End If
  413.             i=i+1
  414.         Loop
  415.     Else
  416.         i=1
  417.         key(1) = keyphrase
  418.     End If
  419.  
  420.     ' if any keyphrase is longer than 80 chars
  421.     '     truncate *before* a wildcard and tell user
  422.     '       use Like(operator)
  423.     '       +, - , | , *
  424.     
  425.     For b%=1 To i
  426.         If (Len(key(b)) > 80) Then
  427.             If (key(b) Like "[|*+-]") Then
  428.                 For pos%= 80 To 1 Step -1
  429.                     ch = Mid$(key(b), pos, 1)
  430.                     If ch="+" Or ch="-" Or ch="|" Or ch="*"  Then
  431.                         key(b) = Left$(key(b), Len(key(b)) - ((Len(key(b))-pos)-1))
  432.                     End If
  433.                 Next
  434.            Else
  435.                LogResult "Keyphrase #" +Str$(b)+ " in " +folder+ " is too long."
  436.                Exit Sub
  437.            End If
  438.        End If
  439.     Next
  440.   
  441.     ' send the keyphrases
  442.     Terminal.Status "Setting Keyphrases..."
  443.     Comms.Send "\r"
  444.     WaitFor "Enter up to 7 Keyphrases"
  445.  
  446.     b%=1
  447.     For b=1 To i
  448.         WaitForPrompt "PromptInput"
  449.         If key(b) <> "" Then
  450.             Comms.Send key(b) + "\r"
  451.         Else
  452.             Comms.Send "\r"
  453.             Exit For
  454.         End If
  455.     Next
  456.  
  457.     WaitForPrompt "Prompt" 
  458.     If PromptMatches("PromptInput") Then
  459.         Comms.Send "\r"
  460.         WaitForPrompt "Prompt" 
  461.     End If
  462.    
  463.     Terminal.Enabled=true
  464.  
  465.     ListENSFolder folder
  466.  
  467.     LogResult folder + " created"
  468.     
  469.     'RAB
  470.     WriteENSFolder folder,False
  471.  
  472.     ReportSuccess id & " : Create ENS Folder " & folder
  473.  
  474.     Cleanup:
  475.     t.delete
  476.     t2.delete
  477.     t3.delete
  478.     t4.delete
  479.     t5.delete
  480.     tWires.delete
  481.     GoTop          ' workaround ENS bug
  482. End Sub
  483.  
  484.  
  485.  
  486. 'T:ListENSFolder (subroutine) (CompuServe)
  487. Sub ListENSFolder(folder As String)
  488.     Dim filename As String
  489.     Dim strip1 As Tracker
  490.  
  491.     Terminal.Enabled=False
  492.     Terminal.Status "Verifying "+folder+" Folder information..."
  493.  
  494.     ' Go to main page - probably already there but you never know...
  495.     If Not GoForum("cis:ens") Then
  496.         LogResult "Failed trying to GO ENS"
  497.         Exit Sub
  498.     End If
  499.     Comms.Send "set lines 0\r"
  500.     WaitForPrompt "Prompt"
  501.  
  502.     filename = UniqueFileName$()
  503.     Capture CAPTURE_ON, filename
  504.     CaptureText Basic.Eoln$+"!start ens/folders CompuServe"+Basic.Eoln$
  505.     CaptureText "Folder: " +folder+Basic.Eoln$
  506.     Set strip1 = CreateTracker("Strip1", "\r\n\r", "StripCapture1", False, False)
  507.  
  508.     Capture CAPTURE_OFF, filename
  509.     Comms.Send "list " + folder + "\r"
  510.     WaitFor "\n"
  511.     WaitFor "\n"
  512.     Capture CAPTURE_ON, filename
  513.  
  514.     WaitFor "Press <CR> !"
  515.     CaptureRewind 13
  516.  
  517.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  518.     Capture CAPTURE_OFF, filename
  519.     strip1.delete
  520.  
  521.     Comms.Send "\r"
  522.     WaitforPrompt "Prompt"
  523.  
  524.     ' Cleanup
  525.     b = QueueFile(Session.Service, filename, IM_DELETE)
  526.     Terminal.Enabled=True
  527. End Sub
  528.  
  529.  
  530.  
  531. 'T:WriteENSFolder (subroutine) (CompuServe)
  532. 'write the Foldernames to UserList.ini so they can be used
  533. '  for %z combo boxes 
  534. '  because you can only have three folders, must have DeleteENSFolder use this Sub too
  535. Sub WriteENSFolder(folder As String, delete As Boolean)
  536.  
  537.    ListIni$ = Session.ServicePath+"userlist.ini"
  538.  
  539.    'if called by Create then check for available item in UserList.ini first
  540.    If Not delete Then
  541.       For itm% = 1 to 3
  542.             If ReadIni$("Folder Name:", itm, ListIni) = "" Then
  543.               WriteIni "Folder Name:", itm, folder, ListIni
  544.         Exit For
  545.          End If
  546.       Next 
  547.    'if called by Delete then delete item 
  548.    '  re-sort the list so it doesn't mess up the combo box
  549.    Else
  550.       For itm% = 1 to 3 Step 1
  551.             If ReadIni$("Folder Name:", Str$(itm), ListIni) = folder Then
  552.               WriteIni "Folder Name:", Str$(itm), " ", ListIni
  553.         num$ = Str$(itm)
  554.         Exit For
  555.          End If
  556.       Next
  557.     
  558.       folder1$ = ReadIni$("Folder Name:", "1", ListIni)
  559.       folder2$ = ReadIni$("Folder Name:", "2", ListIni)
  560.       folder3$ = ReadIni$("Folder Name:", "3", ListIni)
  561.  
  562.       If folder1 = "" Then
  563.          If folder3 <> "" Then
  564.            WriteIni "Folder Name:", "1", folder3, ListIni
  565.            WriteIni "Folder Name:", "3", " ", ListIni
  566.          ElseIf folder2 <> "" Then
  567.            WriteIni "Folder Name:", "1", folder2, ListIni
  568.            WriteIni "Folder Name:", "2", " ", ListIni
  569.          End If
  570.       ElseIf folder2 = "" Then
  571.          If folder3 <> "" Then
  572.            WriteIni "Folder Name:", "2", folder3, ListIni
  573.            WriteIni "Folder Name:", "3", " ", ListIni
  574.          End If
  575.       End If
  576.      
  577.    End If
  578. End Sub
  579.  
  580. 'added by RAB
  581. 'T:RefreshENS (subroutine) (CompuServe)
  582. 'get all personal ENS Folder names, search settings, sync USERLIST.INI with CIS settings
  583. Sub RefreshENS(id As String)
  584.     Dim t As Tracker, PressCR as Tracker
  585.  
  586.     ' Go to main page - this is just a test before we waste our users userlist.ini...
  587.     If Not GoForum("cis:ens") Then
  588.         LogResult "Failed trying to GO ENS"
  589.         Exit Sub
  590.     End If
  591.     Comms.Send "set lines 0\r"
  592.     WaitForPrompt "Prompt"
  593.  
  594.     Terminal.Enabled=True
  595.  
  596.     ' create a blank INI section
  597.     ListIni$ = Session.ServicePath+"userlist.ini"
  598.     WriteIni "Folder Name:", "1", " ", ListIni
  599.     WriteIni "Folder Name:", "2", " ", ListIni
  600.     WriteIni "Folder Name:", "3", " ", ListIni
  601.  
  602.  
  603.     '  This writes the CIS Folder names to USERLIST.INI
  604.     '     \n* before the digit does not work
  605.     Set t = CreateTracker("PromptFolder", "[0-9]* Review folder *\r","FixINI", False, True)
  606.  
  607.     'this is the real deal so we can Tracker the main page
  608.     Terminal.Status "Refreshing your local ENS Folders..."
  609.     Set PressCR = CreateTracker("GoPressCR2", "\nPress <CR> to continue :", "SendCR") ' temp fix to get round washington post problem
  610.     Comms.Send "go cis:ens\r"
  611.     WaitforPrompt "Prompt"
  612.     PressCR.Delete
  613.  
  614.     'take out Tracker here cuz' the rest of this messes it up
  615.     t.delete
  616.  
  617.     '  get the CIS Folder definitions
  618.     For itm% = 1 to 3
  619.        fName = ReadIni$("Folder Name:", Str$(itm), ListIni)
  620.        If fName <> "" Then
  621.           ListENSFolder(fName)
  622.        Else
  623.           Exit For
  624.        End If
  625.     Next 
  626.  
  627.     ' cleanup
  628.     ReportSuccess id & " : ENS Folder information collected"
  629.     Terminal.Enabled=True
  630.     GoTop
  631. End Sub
  632.  
  633. 'added by RAB
  634. 'T:FixINI (subroutine) (CompuServe)
  635. 'Tracker routine for CollectAll that syncs UserList.ini with CIS
  636. Sub FixINI(t As Tracker)
  637.    Dim fName As String
  638.  
  639.    'parse the Folder NAME
  640.    a% = InStr(t.match, "folder")+7
  641.    z% = InStr(t.match, Chr$(40))
  642.    fName = Trim$(Mid$(t.match, a, z-a))
  643.  
  644.    'write UserList.ini
  645.    ListIni$ = Session.ServicePath+"userlist.ini"
  646.    If ReadIni$("Folder Name:", "1", ListIni) = "" Then
  647.       WriteIni "Folder Name:", "1", fName, ListIni
  648.    ElseIf ReadIni$("Folder Name:", "2", ListIni) = "" Then 
  649.       WriteIni "Folder Name:", "2", fName, ListIni
  650.    Else 
  651.       WriteIni "Folder Name:", "3", fName, ListIni
  652.    End If
  653.    
  654.    t.reset
  655. End Sub
  656.  
  657. 'T:CollectAllStories (subroutine) (CompuServe)
  658. Sub CollectAllStories(id As String)
  659.  
  660.     ListIni$ = Session.ServicePath+"userlist.ini"
  661.  
  662.     For itm% = 1 to 3 Step 1
  663.        folder$ = ReadIni$("Folder Name:", Str$(itm), ListIni)
  664.        If folder <> "" Then
  665.            GetENSFolder "", folder
  666.        Else
  667.            ReportSuccess id & " : ENS All stories collected"
  668.            Exit Sub
  669.        End If
  670.     Next
  671.     ReportSuccess id & " : ENS All stories collected"
  672. End Sub
  673.  
  674.  
  675.