Solved

EASY POSTING QUESTION!

Posted on 1998-09-06
12
141 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
 

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now