🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
8 messages
8 total messages Started by Norbert Schmidt Mon, 26 May 2003 15:10
[Dialog] Scripting problem
#125413
Author: Norbert Schmidt
Date: Mon, 26 May 2003 15:10
103 lines
4250 bytes
Hello,

I tried my luck with a little test script, but the result was that it took
40tude down with an access violation and Windows even showed a blue screen. 

What did I do wrong?

> program OnXover;
> 
> uses TextFile;
>                
> procedure ws( var fh:TextFile; s:String; val:String );
> var
> 	os:string;
> begin
> os := Format( '-%20s: %s', [s,val] );
> TextWriteLn( fh, os );
> end;
> 
> procedure wi( var fh:TextFile; s:String; val:integer );
> var
> 	os:string;
> begin
> os := Format( '-%20s: %d', [s,val] );
> TextWriteLn( fh, os );
> end;
> 
> procedure wb( var fh:TextFile; s:String; val:boolean );
> var
> 	os:string;
> begin
> os := Format( '-%20s: %s', [s,val] );
> TextWriteLn( fh, os );
> end;
> 
> procedure wx( var fh:TextFile; s:String; val:integer );
> var
> 	os:string;
> begin
> os := Format( '-%20s: %x', [s,val] );
> TextWriteLn( fh, os );
> end;
> 
> 
> procedure OnXover(Var XoverData:TXoverData);
> var
> 	fh: TextFile;
> begin
> //Your code goes here
> 
> AssignFile( fh, 'Test.40l' );
> Rewrite( fh );
> wi( fh, 'groupkey', XoverData.GroupKey );
> wi( fh, 'articleindex', XoverData.articleindex );
> wb( fh, 'new', XoverData.new );
> ws( fh, 'msgid', XoverData.msgid );
> ws( fh, 'subject', XoverData.subject );
> ws( fh, 'from', XoverData.from );
> ws( fh, 'extradata', XoverData.extradata );
> ws( fh, 'references', XoverData.references );
> wb( fh, 'isreply', XoverData.isreply );
> wx( fh, 'fcolor', XoverData.fcolor );
> wx( fh, 'bcolor', XoverData.bcolor );
> wx( fh, 'bodystate', XoverData.bodystate );
> wx( fh, 'watchstate', XoverData.watchstate );
> 
> CloseFile( fh );
> 
> end;
> 
> begin
> end.

Im fluent in C/C++ and Perl, but my memory about Pascal is quite vague,
since the last time I "spoke" that language was when "Turbo Pascal 2.0" for
CP/M was the best (and only) IDE. So please excuse me if I make beginners
mistakes.


I could post the whole error log that dialog managed to regurgitate before
it died, but that nwouldn't help much. Here's an excerpt that might be
useful (IMHO):

> Stack list, generated 26.05.2003 16:30:02
> [00404480] System.TObject.Free + $8
> [00404B35] System.@HandleOnException + $B1
> [004447B6] JclDebug.TJclStackBaseList.Create (Line 3092, "jcldebug.pas" + 3) + $5
> [0074244F] cScripting.TDialogAppScripts.OnXOver_ (Line 934, "cScripting.pas" + 14) + $1A
> [0054C613] ifps3.FreePIFVariantList (Line 4383, "ifps3.pas" + 6) + $0
> [0074247E] cScripting.TDialogAppScripts.OnXOver_ (Line 939, "cScripting.pas" + 19) + $E
> [00742492] cScripting.TDialogAppScripts.OnXOver_ (Line 943, "cScripting.pas" + 23) + $C
> [007424A8] cScripting.TDialogAppScripts.OnXOver_ (Line 943, "cScripting.pas" + 23) + $22
> [00713356] cThreads.TNNTPGetHeadersThread.NNTPXover (Line 1312, "cThreads.pas" + 110) + $0
> [00713B82] cThreads.TNNTPGetHeadersThread.NNTPXover (Line 1447, "cThreads.pas" + 245) + $144
> [00520239] MyNNTP.TMyNNTP.ProcessXOverList (Line 96, "MyNNTP.pas" + 9) + $0
> [0052027C] MyNNTP.TMyNNTP.ProcessXOverList (Line 99, "MyNNTP.pas" + 12) + $B


Regards, Norbert
-- 
Please post your replies to the news group only.
For questions concerning my address please read <http://www.privacy.net>.
Re: [Dialog] Scripting problem
#125615
Author: Norbert Schmidt
Date: Fri, 30 May 2003 11:36
9 lines
1109 bytes
Hello? 

Nobody? :-(

Regards, Norbert
-- 
Please post your replies to the news group only.
For questions concerning my address please read <http://www.privacy.net>.
Re: [Dialog] Scripting problem
#125616
Author: Bisku
Date: Fri, 30 May 2003 16:12
15 lines
1522 bytes
*Norbert Schmidt*, Fri, 30 May 2003 13:36:40 +0200:

> Hello? 
Hi!

> Nobody? :-(
Well, I think I found the problem at least.

Here it is:
| AssignFile( fh, 'Test.40l' );

Having a look at Mantis you will see a know bug regarding the
subroutine"AssignFile" (ID #553). Seems like the AssignFile-Subroutine
isn't working at all. :-(
Re: [Dialog] Scripting problem
#125619
Author: Juergen Haible
Date: Fri, 30 May 2003 17:05
25 lines
1865 bytes
Norbert Schmidt:

> I tried my luck with a little test script, but the result was that it took
> 40tude down with an access violation and Windows even showed a blue screen. 
> 
> What did I do wrong?

Presumably only Marcus can clarify, why Dialog went down in this case.

>> AssignFile( fh, 'Test.40l' );
>> Rewrite( fh );

Just to clarify:

This "Rewrite" will create a new file for every single XOVER line. If
you don't do something with it within OnXover, it will be overwritten
immediately by the next XOVER line coming in.

And if multiple threads pull headers, this script may/will be called
multiple times as well - *at the same time*. Creating an already open
file will not work, you will at least lose some of your XOVER-files in
this case.

-jh-
Re: [Dialog] Scripting problem
#125625
Author: Marcus Mönnig
Date: Fri, 30 May 2003 19:34
24 lines
2194 bytes
On Fri, 30 May 2003 19:05:21 +0200, Juergen Haible wrote:

> Presumably only Marcus can clarify, why Dialog went down in this case.

There seems to be a problem with AssignFile in scripting. Just like Lars
already said, it's in Mantis already:

http://www.40tude.com/dialog/mantis/view_bug_advanced_page.php?f_id=553

I can reproduce the problem, but I didn't yet look into it.

> And if multiple threads pull headers, this script may/will be called
> multiple times as well - *at the same time*. Creating an already open
> file will not work, you will at least lose some of your XOVER-files in
> this case.

ACK. You will want to open and write to different files in OnXOver.

Marcus
-- 
No replies in private e-mail, please, unless explicitly requested!
Please log bug reports into Mantis: http://www.40tude.com/dialog/mantis/
Please share your scripts and tips: http://www.40tude.com/dialog/wiki/
Re: [Dialog] Scripting problem
#125634
Author: Norbert Schmidt
Date: Fri, 30 May 2003 22:06
45 lines
2418 bytes
Hello Marcus,

>> Presumably only Marcus can clarify, why Dialog went down in this case.
> There seems to be a problem with AssignFile in scripting. Just like Lars
> already said, it's in Mantis already:
> http://www.40tude.com/dialog/mantis/view_bug_advanced_page.php?f_id=553

thanks to you, J�rgen and Bisku.
I missed that one. Maybe I need new glasses. ;-)

I'll try my luck with the Filexxxx() functions. 

Or is there any way to just print some strings to the status/log window?


> I can reproduce the problem, but I didn't yet look into it.

Well, at least it's reproduceable. ;-)


>> And if multiple threads pull headers, this script may/will be called
>> multiple times as well - *at the same time*. 

Ooops. I didn't take that into account.


>> Creating an already open
>> file will not work, you will at least lose some of your XOVER-files in
>> this case.
> ACK. You will want to open and write to different files in OnXOver.

Well, that was just intended as a little test to see if I can still
remember some Pascal after about 20 years. ;-)

I just wanted the _last_ downloaded message dumped in the file. Of course
now I know that this wouldn't have worked either because of multi
threading. :-)



Regards, Norbert
-- 
Please post your replies to the news group only.
For questions concerning my address please read <http://www.privacy.net>.
Re: [Dialog] Scripting problem
#125660
Author: Marcus Mönnig
Date: Sat, 31 May 2003 09:11
13 lines
1835 bytes
On Sat, 31 May 2003 00:06:30 +0200, Norbert Schmidt wrote:

> Or is there any way to just print some strings to the status/log window?

procedure WriteToLog(s: string;LogLevel:integer); 
//Writes some text to Dialog's Log window Loglevel goes from 1 to 7 

Marcus
-- 
No replies in private e-mail, please, unless explicitly requested!
Please log bug reports into Mantis: http://www.40tude.com/dialog/mantis/
Please share your scripts and tips: http://www.40tude.com/dialog/wiki/
Re: [Dialog] Scripting problem
#125663
Author: Norbert Schmidt
Date: Sat, 31 May 2003 11:33
17 lines
1579 bytes
Hello Marcus,

>> Or is there any way to just print some strings to the status/log window?
> procedure WriteToLog(s: string;LogLevel:integer); 
> //Writes some text to Dialog's Log window Loglevel goes from 1 to 7 

Thanks! :-))
That's all I really need for some first steps. :-)

I guess, you don't happen to have a real debugger built in ... ;-)


Regards, Norbert
-- 
Please post your replies to the news group only.
For questions concerning my address please read <http://www.privacy.net>.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads