Solved

EASY POSTING QUESTION!

Posted on 1998-09-06
12
143 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
  • 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

803 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