home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form edit
- Caption = "News Reader"
- ClientHeight = 7350
- ClientLeft = 1815
- ClientTop = 1575
- ClientWidth = 10005
- ControlBox = 0 'False
- Height = 8040
- Icon = WRN.FRX:0000
- Left = 1755
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 7350
- ScaleWidth = 10005
- Top = 945
- Width = 10125
- Begin TextBox Message_text
- BackColor = &H00FFFFFF&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "System"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 6855
- Left = 0
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 0
- Top = 600
- Width = 9975
- End
- Begin PictureBox news_btn
- Height = 495
- Left = 5760
- Picture = WRN.FRX:0302
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 8
- Top = 0
- Width = 495
- End
- Begin PictureBox mail_btn
- Height = 495
- Left = 5280
- Picture = WRN.FRX:0604
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 7
- Top = 0
- Width = 495
- End
- Begin PictureBox uudecode_btn
- Height = 495
- Left = 4320
- Picture = WRN.FRX:0906
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 6
- Top = 0
- Width = 495
- End
- Begin PictureBox rot13_btn
- Height = 495
- Left = 3840
- Picture = WRN.FRX:0C08
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 5
- Top = 0
- Width = 495
- End
- Begin PictureBox cancel_btn
- Height = 495
- Left = 2880
- Picture = WRN.FRX:0F0A
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 4
- Top = 0
- Width = 495
- End
- Begin PictureBox save_btn
- Height = 495
- Left = 2400
- Picture = WRN.FRX:120C
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 3
- Top = 0
- Width = 495
- End
- Begin PictureBox load_btn
- Height = 495
- Left = 1920
- Picture = WRN.FRX:150E
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 2
- Top = 0
- Width = 495
- End
- Begin PictureBox new_btn
- Height = 495
- Left = 1440
- Picture = WRN.FRX:1810
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 1
- Top = 0
- Width = 495
- End
- Begin PictureBox next_btn
- Height = 495
- Left = 0
- Picture = WRN.FRX:1B12
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 9
- Top = 0
- Width = 495
- End
- Begin Menu clip_mnu
- Caption = "&Edit"
- Begin Menu edit_cut_mnu
- Caption = "Cu&t"
- Shortcut = ^T
- End
- Begin Menu edit_copy_mnu
- Caption = "&Copy"
- Shortcut = ^C
- End
- Begin Menu edit_paste_mnu
- Caption = "&Paste"
- Shortcut = ^P
- End
- End
- Begin Menu info_mnu
- Caption = "&Info"
- End
- Begin Menu help_mnu
- Caption = "&Help"
- End
- Sub cancel_btn_Click ()
- edit.message_text.text = ""
- If message.list1.listcount > 0 Then
- message.enabled = True
- End If
- message.catchup_btn.enabled = True: message.catchup_btn.backcolor = white
- new_btn.enabled = True: new_btn.backcolor = white
- cancel_btn.enabled = False: cancel_btn.backcolor = grey
- mail_btn.enabled = False: mail_btn.backcolor = grey
- news_btn.enabled = False: news_btn.backcolor = grey
- End Sub
- Sub edit_copy_mnu_click ()
- ' Copy currently highlighted text to the clipboard
- Dim CopyString As String
- If message_text.SelLength > 0 Then
- CopyString = message_text.SelText
- Clipboard.SetText CopyString
- End If
- End Sub
- Sub edit_cut_mnu_click ()
- ' Cut currently selected text to the clipboard
- Dim CutString As String
- Dim CursorPosition As Integer
- If message_text.SelLength > 0 Then
- CursorPosition = message_text.SelStart
- CutString = message_text.SelText
- Clipboard.SetText CutString
- message_text.text = Left$(message_text.text, message_text.SelStart) + Right$(message_text.text, Len(message_text.text) - (message_text.SelStart + message_text.SelLength))
- message_text.SelStart = CursorPosition
- End If
- End Sub
- Sub edit_paste_mnu_click ()
- ' Paste contents of clipboard into current card
- Dim PasteText As String
- Dim CursorPosition As Integer
- CursorPosition = message_text.SelStart
- PasteText = Left$(message_text.text, message_text.SelStart) + Clipboard.GetText()
- PasteText = PasteText + Right$(message_text.text, Len(message_text.text) - (message_text.SelStart + message_text.SelLength))
- message_text.text = PasteText
- message_text.SelStart = CursorPosition + Len(Clipboard.GetText())
- End Sub
- Sub Form_DblClick ()
- If Not mail_btn.enabled Then
- message_text.SetFocus
- If replying Then
- msg_text$ = message_text.text
- i& = InStr(msg_text$, Chr$(10))
- While i& <> 0
- msg_text$ = Left$(msg_text$, i&) + msg_quote$ + Mid$(msg_text$, i& + 1)
- i& = i& + 3
- i& = InStr(i&, msg_text$, Chr$(10))
- Wend
- message_text.text = msg_text$
- Else
- message_text.text = ""
- End If
- message.catchup_btn.enabled = False: message.catchup_btn.backcolor = grey
- message.enabled = False
- cancel_btn.enabled = True: cancel_btn.backcolor = white
- mail_btn.enabled = True: mail_btn.backcolor = white
- If Not reading_mail Then
- news_btn.enabled = True: news_btn.backcolor = white
- End If
- End If
- End Sub
- Sub Form_Load ()
- mail_btn.enabled = False: mail_btn.backcolor = grey
- news_btn.enabled = False: news_btn.backcolor = grey
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Unload file_select
- Unload aboutbox
- End Sub
- Sub get_block (ByVal file_no%, ByVal length%, dest$)
- If Loc(file_no%) + length% > LOF(file_no%) Then
- dest$ = dest$ + Input$(LOF(file_no%) - Loc(file_no%), file_no%)
- Else
- dest$ = dest$ + Input$(length%, file_no%)
- End If
- End Sub
- Sub get_next_name (ByVal Path$, dest$)
- i = 1
- dest$ = Path$ + "." + Mid$(Str$(i), 2)
- While Len(Dir$(dest$)) <> 0 And i < 1000
- i = i + 1
- dest$ = Path$ + "." + Mid$(Str$(i), 2)
- Wend
- End Sub
- Sub Help_mnu_Click ()
- res = winexec("WINHELP WRN.HLP", 1)
- End Sub
- Sub info_mnu_Click ()
- edit.enabled = false
- aboutbox.Show
- End Sub
- Sub load_btn_Click ()
- filename$ = get_filename("c:\")
- If Len(filename$) <> 0 Then
- message_text.text = load_file(filename$)
- End If
- End Sub
- Sub mail_btn_Click ()
- dest$ = author$
- sig% = 1
- Call get_header(dest$, subject$, sig%, True)
- seq_file = fopen(seq_path$, "r")
- Input #seq_file, seq_num%
- Close #seq_file
- seq$ = Format$(seq_num%, "0000")
-
- out_filename$ = out_path$ + seq$
- date_time$ = Format$(Now, "ddd, dd mmm yy hh:mm:ss ") + time_zone$
- cur_time# = Now
- out_file = fopen(out_filename$ + ".DAT", "w")
- Print #out_file, "From " + user_id$ + " " + date_time$ + Chr$(10);
- Print #out_file, "Received: by " + site_name$ + " (1.65/waf+wrn)" + Chr$(10);
- Print #out_file, Chr$(9) + "via UUCP; " + date_time$ + Chr$(10);
- Print #out_file, Chr$(9) + "for " + dest$ + Chr$(10);
- Print #out_file, "To: " + dest$ + Chr$(10);
- Print #out_file, "Subject: " + subject$ + Chr$(10);
- Print #out_file, "From: " + user_id$ + "@" + site_name$ + " (" + full_name$ + ")" + Chr$(10);
- Print #out_file, "Message-ID: <" + Right$("0000" + Hex$(Int(cur_time#)), 4) + Right$("0000" + Hex$((cur_time# - Int(cur_time#)) * 65536), 4) + user_id$ + "@" + site_name$ + ">" + Chr$(10);
- Print #out_file, "Date: " + date_time$ + Chr$(10);
- If replying And (Len(msg_id$) <> 0) Then
- Print #out_file, "In-Reply-To: " + msg_id$ + Chr$(10);
- End If
- Print #out_file, "Organization: " + organisation$ + Chr$(10);
- Print #out_file, Chr$(10);
- msg_text$ = message_text.text + signature(sig%)
- pos = InStr(msg_text$, new_line)
- While pos <> 0
- Print #out_file, Left$(msg_text$, pos - 1) + Chr$(10);
- msg_text$ = Mid$(msg_text$, pos + 2)
- pos = InStr(msg_text$, new_line)
- Wend
- Close #out_file
- out_file = fopen(out_filename$ + ".CMD", "w")
- Print #out_file, "S " + seq$ + ".DAT D.whare" + seq$ + " " + user_id$ + " - " + seq$ + ".DAT 0666"
- Print #out_file, "S " + seq$ + ".XQT X.whare" + seq$ + " " + user_id$ + " - " + seq$ + ".XQT 0666"
- Close #out_file
- out_file = fopen(out_filename$ + ".XQT", "w")
- Print #out_file, "U " + user_id$ + " whare" + Chr$(10);
- Print #out_file, "Z" + Chr$(10);
- Print #out_file, "F D.whare" + seq$ + Chr$(10);
- Print #out_file, "I D.whare" + seq$ + Chr$(10);
- Print #out_file, "C rmail " + dest$ + Chr$(10);
- Close #out_file
- seq_file = fopen(seq_path$, "w")
- Print #seq_file, seq_num% + 1
- Close #seq_file
- Call cancel_btn_Click
- End Sub
- Sub new_btn_Click ()
- message_text.text = ""
- subject$ = ""
- author$ = ""
- replying = False
- new_btn.enabled = False: new_btn.backcolor = grey
- reading_mail = False
- message_text.SetFocus
- End Sub
- Sub news_btn_Click ()
- sig% = 1
- dest$ = message.combo1.list(message.combo1.listindex)
- Call get_header(dest$, subject$, sig%, False)
- seq = 0
- out_filename$ = news_reply$ + "reply" + Mid$(Str$(seq), 2)
- While Len(Dir$(out_filename$)) <> 0
- seq = seq + 1
- out_filename$ = news_reply$ + "reply" + Mid$(Str$(seq), 2)
- Wend
- date_time$ = Format$(Now, "ddd, dd mmm yy hh:mm:ss ") + time_zone$
- cur_time# = Now
- out_file = fopen(out_filename$, "w")
- Print #out_file, "Path: " + site_name$ + "!" + user_id$
- Print #out_file, "From: " + user_id$ + "@" + site_name$ + " (" + full_name$ + ")"
- Print #out_file, "Newsgroups: " + dest$
- Print #out_file, "Subject: " + subject$
- Print #out_file, "Message-ID: <" + Right$("0000" + Hex$(Int(cur_time#)), 4) + Right$("0000" + Hex$((cur_time# - Int(cur_time#)) * 65536), 4) + user_id$ + "@" + site_name$ + ">"
- Print #out_file, "Date: " + date_time$
- If replying And (Len(msg_id$) <> 0) Then
- Print #out_file, "References: " + msg_id$
- End If
- Print #out_file, "Organization: " + organisation$
- Print #out_file, ""
- Print #out_file, message_text.text
- temp$ = signature(sig%) ' Wierd bug to do with calling signature in print stmt
- Print #out_file, temp$;
- Close #out_file
- out_file = fopen(out_news_list$, "a")
- Call change_chars("\", "/", out_filename$)
- Print #out_file, out_filename$
- Close #out_file
- reply_written = True
- Call cancel_btn_Click
- End Sub
- Sub next_btn_Click ()
- If message.list1.listindex < message.list1.listcount - 1 Then
- message.list1.listindex = message.list1.listindex + 1
- Else
- If message.combo1.listindex < message.combo1.listcount - 1 Then
- message.combo1.listindex = message.combo1.listindex + 1
- Else
- Beep
- End If
- End If
- End Sub
- Sub prune (text_line$, target$)
- target_pos = InStr(text_line$, target$)
- If target_pos <> 0 Then
- text_line$ = Left$(text_line$, target_pos - 1) + Mid$(text_line$, InStr(target_pos, text_line$, Chr$(10)) + 1)
- End If
- End Sub
- Sub rot13_btn_Click ()
- msg_text$ = message_text.text
- For i% = 1 To Len(msg_text$)
- ch$ = Mid$(msg_text$, i%, 1)
- If (ch$ >= "A" And ch$ <= "M") Or (ch$ >= "a" And ch$ <= "m") Then
- Mid$(msg_text$, i%, 1) = Chr$(Asc(ch$) + 13)
- Else
- If (ch$ >= "N" And ch$ <= "Z") Or (ch$ >= "n" And ch$ <= "z") Then
- Mid$(msg_text$, i%, 1) = Chr$(Asc(ch$) - 13)
- End If
- End If
- Next i%
- message_text.text = msg_text$
- End Sub
- Sub save_btn_Click ()
- filename$ = get_filename(Left$(mail_file$, Len(mail_file$) - 8))
- If Len(filename$) <> 0 Then
- save_file = fopen(filename$, "a")
- If reading_mail Then
- msg_text$ = get_mail(message.list1.listindex)
- Print #save_file, msg_text$
- Else
- in_file = fopen(msg_filename, "r")
- While Not EOF(in_file)
- Input #in_file, msg_line$
- Print #save_file, msg_line$
- Wend
- Close #in_file
- End If
- Close #save_file
- End If
- End Sub
- Function signature (ByVal sig_flag%) As String
- If registered Then
- If sig_flag% = 1 Then
- signature = new_line + "--" + new_line + load_file(sign_filename$) + new_line
- Else
- signature = ""
- End If
- Else
- signature = new_line + "--" + new_line + "Using an unregistered copy of WRN v0.94" + new_line
- End If
- End Function
- Sub uudecode_btn_Click ()
- Call make_dir(message.combo1.list(message.combo1.listindex), Dirname$)
- file$ = message.list1.list(message.list1.listindex)
- file$ = Left$(file$, InStr(file$, ":") - 1)
- res = winexec(uudecoder$ + " " + Dirname$ + file$, 1)
- End Sub
-