Re: [twsocket] A bug with Pop3 - followup

2010-07-01 Thread Arno Garrels
DZ-Jay wrote:
 Zvone wrote:
 Also... if someone is into Delphi and has wiki access, I would
 suggest to translate my example code to Delphi. I'm not so much into
 Delphi so I could make a messy code when translating it but I'll try
 to keep examples very simple and not use c++-ish stuff like ?: and
 similar so it should be fairly easy to understand even if not
 translated to Delphi. 
 
 Done.

Changed your translation, it was full of bugs and neither followed
the official Delphi nor the ICS code format.

--
Arno Garrels   


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-07-01 Thread Arno Garrels
Zvone wrote:

 So if you changed some of the wiki pages now you can surround it with
 these tags and make your code look nicer.

Looks nice with C++, however the Delphi colors should be changed.  

--
Arno Garrels
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-07-01 Thread DZ-Jay

On Jul 01, 2010, at 02:55, Arno Garrels wrote:

 Changed your translation, it was full of bugs and neither followed
 the official Delphi nor the ICS code format.

Sorry, I didn't have Delphi at hand and didn't compile the code, so I missed 
removing the case keywords from the switch statement.

As for the style, I'll brush up on ICS official guidelines; it's been a while.

Thanks,
dZ.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-07-01 Thread Zvone
 So if you changed some of the wiki pages now you can surround it with
 these tags and make your code look nicer.
 Looks nice with C++, however the Delphi colors should be changed.

I didn't want to go into styling because it is a matter of preference. The
colors as they are now are defaults of GeSHi and are very similar to the
ones used for example on Wikipedia - see:
http://en.wikipedia.org/wiki/Delphi_programming_language and
http://en.wikipedia.org/wiki/C%2B%2B

But styling is easy - providing you have access to the server. I have
MediaWiki installed locally so I can edit help locally and upload when
finished and it is only a matter of modifying GeSHi language .php files for
example in:
extensions\SyntaxHighlight_GeSHi\geshi\geshi\delphi.php

You will find:

'STYLES' = array(
'KEYWORDS' = array(
1 = 'color: #00; font-weight: bold;',
2 = 'color: #00; font-weight: bold;',
3 = 'color: #66;',
4 = 'color: #66; font-weight: bold;'
),
'COMMENTS' = array(
1 = 'color: #808080; font-style: italic;',
2 = 'color: #008000; font-style: italic;',
'MULTI' = 'color: #808080; font-style: italic;'
),
etc...

These are colors of delphi output... so... style to... whatever you want
them to be. Don't introduce CSS errors though.

C++ colors are in: cpp.php also under 'STYLES' array

So change it to whatever you like or think they may be. I'm at home with PHP
and CSS but I'm not going into that issue, I just suggested to Francois -
Delphi and C++ builder default interface colors to look familliar, but he
has no time to change these so if you modify the files send it to him. I can
do the styling that's a piece of cake, but it has to be a popular vote :)
Simply send me 24-bit PNG screenshots of code and I can work with that (they
have to be PNG to avoid JPG messing with colors as it is lossy and PNG is
not).

Whatever you decide - make sure after styling it to save the changed files
because if GeSHi is updated you may overwrite the styling files so to avoid
that.. backup these.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-07-01 Thread Arno Garrels
DZ-Jay wrote:

 Sorry, I didn't have Delphi at hand and didn't compile the code, so I
 missed removing the case keywords from the switch statement. 

That wasn't the only one ;)

 As for the style, I'll brush up on ICS official guidelines; it's been
 a while. 

I like the ICS code style, it's close to the offical Delphi and my own
except for the uppercase String and the hanging begin (both should 
IMO be changed).

--
Arno Garrels

 

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-06-30 Thread Arno Garrels
Zvone wrote:
 I'll put it in the wiki documentation when updating it along with
 one complete example. 

Thanks for your wiki-input!

--
Arno Garrels  
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-06-30 Thread Zvone
 Thanks for your wiki-input!
 Arno Garrels

Thank you for your answers that helped me. By the way, I suggested to
Francois to install Geshi for code-coloring, if you refresh the page on:
http://wiki.overbyte.be/wiki/index.php/TPop3Cli.List

You'll see how it looks much nicer now. The only important things I
suggested already to him is to modify default tab-width to 4 spaces instead
of 8 and to surround code in light-gray dashed border like on many other
wiki-s so that copy-pasting code is easier...

Now the code coloring is a matter of simply pasting it to the wiki and
surrounding it with the tags:

syntaxhighlight lang=delphi
/syntaxhighlight

for delphi... or...

syntaxhighlight lang=cpp
/syntaxhighlight

for c++ builder.

So if you changed some of the wiki pages now you can surround it with these
tags and make your code look nicer.

Geshi can also add line numbers and a few more things documented here:
http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi

Anyway... more pop3 pages updates will follow... this is just the first one
I did.

Also... if someone is into Delphi and has wiki access, I would suggest to
translate my example code to Delphi. I'm not so much into Delphi so I could
make a messy code when translating it but I'll try to keep examples very
simple and not use c++-ish stuff like ?: and similar so it should be fairly
easy to understand even if not translated to Delphi.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-06-30 Thread DZ-Jay

Zvone wrote:

Also... if someone is into Delphi and has wiki access, I would suggest to
translate my example code to Delphi. I'm not so much into Delphi so I could
make a messy code when translating it but I'll try to keep examples very
simple and not use c++-ish stuff like ?: and similar so it should be fairly
easy to understand even if not translated to Delphi.


Done.

dZ.

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-06-30 Thread Francois PIETTE

Zvone wrote:

Also... if someone is into Delphi and has wiki access, I would suggest to
translate my example code to Delphi. I'm not so much into Delphi so I 
could

make a messy code when translating it but I'll try to keep examples very
simple and not use c++-ish stuff like ?: and similar so it should be 
fairly

easy to understand even if not translated to Delphi.


Done.


Thanks a lot.
As much as possible, use ICS coding style as described in the doc file which 
is in the distribution.


--
francois.pie...@overbyte.be
http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-06-29 Thread Arno Garrels
Hello Zvone,

Zvone wrote:
 I tried synchronous calls now and discovered that event trigger is not
 necessary related to UIDL after LIST:

You have to reset property MsgNum to zero before both List() and Uidl().

--
Arno Garrels


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-06-29 Thread Zvone
 You have to reset property MsgNum to zero before both List() and Uidl().

Alright, that seems to work, although it is not entirely logical to me. I'll
put it in the wiki documentation when updating it along with one complete
example. Thanks Arno.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] A bug with Pop3 - followup

2010-06-29 Thread DZ-Jay

Zvone wrote:

You have to reset property MsgNum to zero before both List() and Uidl().


Alright, that seems to work, although it is not entirely logical to me. I'll
put it in the wiki documentation when updating it along with one complete
example. Thanks Arno.


Simple: when you call LIST with no parameters, the command is issued in 
list mode, so that all messages are listed and an event is triggered 
per message.  The same for the UIDL command.


During the processing of both commands in list mode, the MsgNum 
properly is incremented (actually, it is extracted from the first 
numeric value for each line returned by the server, which represents the 
message number), so that at the end of the command, the MsgNum property 
points to the last message in the list returned.


If you issue UIDL after LIST (or vice versa, or the same command twice 
in a row), since the MsgNum property is non-zero, only *that* message is 
retrieved.  The events for list mode described before are not 
triggered because no list is returned; only OnRequestDone is triggered, 
as with any other command which expects a single line.


As Arno said, if you want to call UIDL and LIST in list mode, you must 
make sure that the the MsgNum property is set to zero.


I hope this helps,
dZ.


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] A bug with Pop3 - followup

2010-06-28 Thread Zvone
I tried synchronous calls now and discovered that event trigger is not
necessary related to UIDL after LIST:

SyncPop3Cli1-Host = pop3.host.name;
SyncPop3Cli1-Port = 110;
SyncPop3Cli1-UserName = username;
SyncPop3Cli1-PassWord = password;
SyncPop3Cli1-ConnectSync();
SyncPop3Cli1-UserSync();
SyncPop3Cli1-PassSync();
SyncPop3Cli1-StatSync();
Memo1-Lines-Add(Messages: +IntToStr(SyncPop3Cli1-MsgCount));
SyncPop3Cli1-ListSync();
SyncPop3Cli1-QuitSync();

I put this on some button. The first time I call it List works (or if the
program is restarted). The second time I call it, all works except that List
does not trigger events again. Same goes if I replace it with UidlSync,
again works the first time, no event trigger the second time.

Now, unless I didn't do some necessary cleanup between two calls, this
should work when called twice in a row without restarting a program (which
only destroys and creates Pop3 component). So my guess is that there is an
issue related with UIDL, LIST and repeated calls one after another...

I also tried to set or clear event handlers:

SyncPop3Cli1-OnListLine = NULL;
SyncPop3Cli1-OnUidlLine = NULL;
SyncPop3Cli1-OnListLine = SyncPop3Cli1ListLine;
SyncPop3Cli1-OnUidlLine = SyncPop3Cli1UidlLine;

In various combinations, to see if setting or releasing event handler would
do any change - no change.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be