Solved

EASY POSTING QUESTION!

Posted on 1998-09-06
12
145 Views
Last Modified: 2010-04-06

I am developing a NewsGroup posting application and I just want to a have a message attached to every message the enduser post.  How can I do this?  Also on a different subject how do I create a counter to count the number of lines automatically in a Memo or ListsBox?   I need a quick answer to both questions if possible.

Thanks

0
Comment
Question by:aj85
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1338810
Q#2) CountLines := Memo1.Lines.Count;

Regards,
Viktor Ivanov

0
 
LVL 4

Expert Comment

by:erajoj
ID: 1338811
You have to be more specific on the first question.
NNTP components? How do you store messages?
Are the messages in a memo control? How should the messages be attached? Appended? Inserted? Formatted?

If you are using a richedit, memo or other TString based control then to append a previously defined "message"/text from another TStrings/TStringList (which is very common), then just use:

  MyMessage: TStringList;  
  ...
  Memo1.Lines.AddStrings( MyMessage );
  or
  Memo1.Lines.AddStrings( Memo2.Lines );
  or
  UserMessage{TStringList}.AddStrings( MyMessage );

/// John
0
 

Expert Comment

by:clopez
ID: 1338812
I don't get your Idea.

1.- You want to send a second  message each time the user send one? You want to automaticaly replay?

2.- You mean a counter on the form (like whe editing strings in the IDE)?

procedure TForm1.Memo1Change(Sender: TObject);
begin
   Label1.Caption:=IntToStr(Memo1.Lines.Count);
end;



0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:aj85
ID: 1338813

Clopez,

You have the second question, I think.  What I am saying is that if I had a listbox and wanted to count the number of lines of data as it they are being added.  The first question is that I just want to add a message to every message the enduser post.
0
 

Expert Comment

by:clopez
ID: 1338814
I don't get the second one.

1.- Is your application:
   A.- A new server (It receives messages.)
   B.- A client (It sends messages to a server on a user command)
   C.- A proxy (It gets data from a client app and send it to a news server).

2.- Do you want to:
   A.- Add that message to the end of the user message.
   B.- Add another message to the news server.
   C.- Send back a message to the client. ??? (Not easy)
0
 

Author Comment

by:aj85
ID: 1338815


Clopez,

Thanks for giving me several options to choose from, the answer that I am looking for is: 1B & 2A.  I want the enduser to send massages to the server & I want to have a hard-code message attached to the message the enduser post.  I hope this helps you answer this one so that I can give you the points.  Your answer to my first question was very clear and it worked like a charm!

Thanks,
Tony
0
 

Author Comment

by:aj85
ID: 1338816

Sorry, I meant your answer to my second question, i.e. the counter question.

Tony
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1338817
Isn't the information already provided sufficient to solve your problems? In that case, what are you missing? There is really nothing else to add here?!

/// John
0
 

Expert Comment

by:clopez
ID: 1338818
Lets see if I am right.

I suppose you have a form with a couple of edits (as an news group address, subject ...)  and a memo (as the message), you also have a button (or a menu option) that whe the user press it the message gets sent to the server.  It's that ok?

What you what to do is to send another message to the server at the same time.  And you also want to have this message linked to the first message like a follow up message?

Or, you what to send a file (or some attached data like a signature) in the same message?


0
 

Author Comment

by:aj85
ID: 1338819


Clopez,

You are correct in that I want to attach a file much like a data signature, in the same message.  I you can answer this, I will release your points.

Thanks


0
 
LVL 3

Expert Comment

by:rickpet
ID: 1338820
aj85...

It really comes down to how you are sending through your NNTP component...(I assume you are using a component)


slSignature: TStringList;
.
slSignature := TStringList.create;
with slSignature do begin
  Add('This is a signature');
end;

.

with Memo1 do begin
  for i:= 0 to slSignature.count -1 do
    Add(slSignature.Lines[i];

???PostNewsMessage(Message: TString);

If this is the case...use Assign to copy your Memo to your Message...

Rick
0
 

Accepted Solution

by:
clopez earned 100 total points
ID: 1338821
Ok, sorry it took me so long.  I've been trying to chekck if the answer works.

Add to the end of the text message a line like:

begin <filesize> <filename>

then UUEncode your signature (attachment) and place it after that

end up with a line saying "end" and thats it.  So it will look like

begin <filesize> <filename>
<UUEncoded Data>
<UUEncoded Data>
<UUEncoded Data>
<UUEncoded Data>
end

If you whant to see how it is done.  I took a look to the Forte Agent News reader.  I posted a message with an attachment to a group and the when I got it back I set in the menu Message\Show Raw Message.   Before posting check that under Group\Default properties, on the Send Files Tab that Attachment Placement is "Inline MIME Section".

For UUEncoding you can find a couple of component in the DSP page:

http://SunSITE.icm.edu.pl/delphi/

Hope it works for you.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question