🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #114352

Re: [Dialog] Where is the full scripting langurage reference?

#114352
From: matija
Date: Wed, 13 Nov 2002 09:59
102 lines
5062 bytes
Bob Frank, completely geschtonkenflapped, wrote:
>> dialog's scripting is almost useless at the time being. 
> 
> That seems awfully harsh.  From what I've seen posted here it looks like 
> the scripting is extremely useful.  It may not be easy for us 
> non-programmers, but that certainty doesn't mean that it's "almost 
> useless."

     1) it's a bit hard for non-programmers;
     2) programmers don't have much to tweak.
     
     yes, you can do _some_ things in dialog's scripting, but for
     a lot you have to resort to external DLL calls and battle with
     obscure and (bad) documentation from both dialog and microsoft.
     thank god i have delphi with the RTL and VCL sources ... :)
     that's exactly the reason i said it's almost useless - not many
     examples in dialog, much less proper documentation and events.


>> for example, i wanted to code a script that would override dialog's
>> onshutdown event and popup a message box saying "close dialog: yes/no". i
>> guess that's impossible...
> 
> Just because you couldn't figure out how, or this is a feature not 
> supported by scripting, doesn't mean that scripting is "almost useless."

     it just strikes me as odd that the onstartup/onshutdown events
     are procedures instead of functions.


> It seems to me that what you want to do would be outside the abilities of 
> any scripting language anyway.

     not at all. all i need is "function OnShutDown : boolean;"
     instead of "procedure OnShutdown;" and then i can have

---     
program OnShutdown;

const MB_YESNO = 4; 
      IDYES = 6;
      IDNO = 7;

function MessageBox(hWnd: longword; lpText, lpCaption: PChar; uType: longword): Integer; external 'MessageBoxA@user32.dll stdcall';

function OnShutdown : boolean;
begin
  if (MessageBox(null, 'Do you want to close Dialog?', 'Close Dialog', MB_YESNO) = IDYES)
    then result := true
    else result := false;
end;

begin
end.     
---

     right now all i can do is display a "thank you for using dialog"
     message box and do the same when it's starting up. what else?
     

---
program OnXover;

procedure OnXover(Var XoverData:TXoverData);
begin
  if (pos("sender name", XoverData.From) <> 0)
    then XoverData.Score := 100;
end;

begin
end.
---

     this piece of code is indeed useless because that same thing can
     be accomplished by scoring. that and dialog's exposed options take
     care of the rest of TXoverData members. the onbeforesendingmessage
     event seems nice, but how the hell am i supposed to figure out
     what "var Message: TStringlist" consists of? if it's just plain
     text with plain headers and plain text content (i guess it is,
     but who knows), one could add custom x-headers depending on the
     group/sender you're replying to (or something). could be fun if
     you picked on someone and every followup to that person's post
     would have "x-john-doe: MAJOR TROLL!!!" added automatically or
     the x-face changed :)

     i'd also like to code a gravity-like VCR function: a dialog
     box with the names of all newsgroups you're subscribed to.
     you put checkboxes next to those for which you want to retrieve
     headers and/or bodies, perhaps set up a timer, click "OK" and
     have dialog get the things you want. well, i can't do that now
     because i don't have access to the subscribed newsgroup list.
     
     so, dialog's scripting is both useful and useless at the same
     time. would we find middle ground on this issue if i just said
     it's LIMITED at the time being? :)


-- 
there is a cheer. the gnomes have learned a new way to say hooray.   [-shpongle]

address is scrambled - remove SPAMISEVIL to reply
Technical Details
Message-ID: <1cpj5e077xa7a$.dlg@shpongle.604>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fu-berlin.de!carnet.feed!CARNet.hr!not-for-mail
References: <xmguv8ql8pnj.1gxaqdncmjmz6$.dlg@40tude.net> <im5enjhqnmsb$.dlg@shpongle.604> <1snrd6deetht6.1wqda2vfifq3y$.dlg@40tude.net>

Show Full Headers
Complete Article Headers
Message-ID: <1cpj5e077xa7a$.dlg@shpongle.604>
Subject: Re: [Dialog] Where is the full scripting langurage reference?
Date: Wed, 13 Nov 2002 10:59:18 +0100
From: matija <mSkPrAnMic@jaIgSor.srEcVe.IhLr>
References: <xmguv8ql8pnj.1gxaqdncmjmz6$.dlg@40tude.net> <im5enjhqnmsb$.dlg@shpongle.604> <1snrd6deetht6.1wqda2vfifq3y$.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fu-berlin.de!carnet.feed!CARNet.hr!not-for-mail
Newsgroups: news.software.readers
Organization: 604
Lines: 101
NNTP-Posting-Host: a2035.cmu.carnet.hr
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: bagan.srce.hr 1037181561 19603 193.198.144.115 (13 Nov 2002 09:59:21 GMT)
X-Complaints-To: abuse@carnet.hr
NNTP-Posting-Date: 13 Nov 2002 09:59:21 GMT
X-Face: "7>Vm?rO.@qh|TIsbG@X7>asBJ8BSLKs%T@Wd+qgN<P?}[3`e1(M~;NT:f=hn#iN:nyAWyT fR9pPzc9ON|MqY_5Fvk)9[+7Lu!%Ihw.GS]KBQF6K_Vn1J2sB{Ne@3Fa5G-z
User-Agent: 40tude_Dialog/2.0.2.1