๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #261561

Re: Ping Bernd Rose: How do you set and define a variable in 40Tude Dialog

#261561
From: Bernd Rose
Date: Mon, 02 Jan 2017 18:38
49 lines
3704 bytes
On Mon, 2nd Jan 2017 02:49:30 +0100, Stijn De Jong wrote:

> Thanks Bernd for the syntax help in setting variables in 40tude language.
> 
> That snipped works just fine standalone:
[...] 
> Integrating the snippet into the OnBeforeSendingMessage utility is the task
> at hand, where an integration requires insertion into the if/then/else.
> 
> I spent a few hours more and finally gave up as my conclusion is that the
> syntax is just too daunting for a novice to overcome without prior
> knowledge of (probably quite a few) programming languages.

You should read the reference recommended by the author of 40tude Dialog,
Marcus Mรถnnig! If you follow the link provided in the help file:

http://www.marcocantu.com/epascal/default.htm

you get to the main page, which forkes to different versions, languages, 
and places where a print-out book can be acquired. The current English 
version starts here:

http://www.marcocantu.com/epascal/English/default.htm

If you take a look in chapter 11, you'll notice your main error: "end." 
(with dot, /not/ with semicolon!) is the *last* instruction of a program.
The code of that *program* starts with the only same-level "begin" which
appears between "program" and "end." There may be lots of other "begin" /
"end;" (note the semicolon!) statements embedded. They need to /always/
come in pairs and /must not/ written entangled (like begin[1] - begin[2] -
end;[1] - end;[2]. Correct order is <last opened has to be closed first>,
e.g.: begin[1] - begin[2] - end;[2] - end;[1].

All declarations (var and const definitions, /as well as/ procedure and
function definitions[!!] appear between "program" and the program-level 
"begin".

In your case, a special situation has to be regarded, though. All event 
scripts in Dialog are /not/ run as a program. Therefore, the section
between program-level <begin - end.> is empty in both your basis scripts
you copied from datalist.org. (And is empty in every newly-created event 
script stub in the Dialog scripting editor.) Event scripts have to carry
an "overload" function of the same name as the event. If you wish to
modify the normal OnBeforeSendingMessage behavior, you need to create
an event script, which has a program stub that carries a function named
OnBeforeSendingMessage inside the declaration area of the program.

HTH.
Bernd
Technical Details
Message-ID: <w4daz9t9jqbr$.dlg@b.rose.tmpbox.news.arcor.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
References: <o4bg7v$t51$1@gioia.aioe.org> <1xmerwn6hkw2o.dlg@b.rose.tmpbox.news.arcor.de> <o4cbjs$4pc$1@gioia.aioe.org>

Show Full Headers
Complete Article Headers
Message-ID: <w4daz9t9jqbr$.dlg@b.rose.tmpbox.news.arcor.de>
Subject: Re: Ping Bernd Rose: How do you set and define a variable in 40Tude Dialog
Date: Mon, 2 Jan 2017 19:38:13 +0100
From: Bernd Rose <b.rose.tmpbox@arcor.de>
References: <o4bg7v$t51$1@gioia.aioe.org> <1xmerwn6hkw2o.dlg@b.rose.tmpbox.news.arcor.de> <o4cbjs$4pc$1@gioia.aioe.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers
Organization: albasani.net
Lines: 49
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: news.albasani.net 8w0cOmZf7apbCtpugPmKoF1DzJUvnd9eggm1T0NFJ+Hx4C7G5zpHJjP2LuWBdkMQECeYueUjeIyj9D9kgh6eRg==
NNTP-Posting-Date: Mon, 2 Jan 2017 18:38:14 +0000 (UTC)
Injection-Info: news.albasani.net; logging-data="hoj3mlFn+LZeGMeL/38d8BDr6ZnSiDrX9gAOOtKICJCOSB/84HoMMDWuI7z3Nvs/ecjm02MhUmDXC1QybtZ42dKb7QcN2/PYWmM9hctIqhzPLe1mqZ1XG+4vp3Vlr5aX"; mail-complaints-to="abuse@albasani.net"
User-Agent: 40tude_Dialog/2.0.15.41 (915d31b7.143.496)
Cancel-Lock: sha1:U1AimPP0fsyqIbGUFYkYsdPbLKA=
X-Received-Body-CRC: 668336920
X-Received-Bytes: 3635