[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - To Slaven: corrections to pocoscript.html file

To Slaven: corrections to pocoscript.html file

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

To Slaven: corrections to pocoscript.html file

Postby MarkB » Thu Sep 07, 2006 7:38 am

Slaven, when you revise the definition of PocoVersion in pocoscript.html, if you want to make some other corrections...



============================================================
Corrections to HTML
============================================================

CHANGE THIS:
Code: Select all
<b><a name="SubStrings">SubStrings</a> $a $b</b>
<p>It will delete substring $b from $a. Be careful to include leading or trailing spaces if operand $b if necessary. For example, the following commands:</p>
<p><i>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $a "This is a sentence."<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SubStrings $a "is"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox $a<br>
</i></p>
will produce "<i>Th is a sentence.</i>"

<b><a name="Trim">Trim</a> $a</b>


TO THIS (move </p>; "Trim" should be on a new line):
Code: Select all
<b><a name="SubStrings">SubStrings</a> $a $b</b>
<p>It will delete substring $b from $a. Be careful to include leading or trailing spaces if operand $b if necessary. For example, the following commands:</p>
<p><i>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $a "This is a sentence."<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SubStrings $a "is"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox $a<br>
</i>
will produce "<i>Th is a sentence.</i>"</p>

<b><a name="Trim">Trim</a> $a</b>



============================================================
Orthography
============================================================

CHANGE defaul TO default

CHANGE specifed TO specified

CHANGE extention TO extension

CHANGE facilite TO facilitate

CHANGE multi-line TO multiline (for consistency)

CHANGE RFC 822 TO RFC822 (or vice versa, for consistency)

CHANGE runtime TO run time (for nouns)

CHANGE runtime TO run-time (in the attributive position)

run time (n), run-time (adj)
Never run together into one word (that is, not runtime). Capitalize both words in headings.
Microsoft Manual of Style


CHANGE drop down box TO drop-down box

drop-down (adj.), drop down (v.)


CHANGE e-mail TO email (or vice versa, for consistency)

CHANGE it's opposite value TO its opposite value

CHANGE broken off short lines TO broken-off short lines

CHANGE string as setup in Options TO string as set up in Options

set up (v), setup (adj, n), Setup (the program)
Note the spelling according to grammatical function. Always spell the verb as two words; never hyphenate it.

Verb
Have everything unpacked before you set up your computer.

Adjective
The setup time should be about 15 minutes.

Noun
Your office setup should be ergonomically designed.
Run Setup before you open other programs.
Insert Setup Disk 1 in drive A.

Microsoft Manual of Style


CHANGE To manually setup a script TO To manually set up a script

CHANGE To setup a script: TO To set up a script:

CHANGE stand alone scripts TO stand-alone scripts
http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=stand-alone


============================================================
Grammar
============================================================

COMMA SPLICE: A tutorial is also available, it walks you through the creation of a couple of the scripts provided with PocoMail.

MISSING WORD (an): PocoScript is [an] interpreted, high-level language, run directly by PocoMail itself.

COMMA SPLICE: Scripts in this category do not have access to the message body, they can only act on the message headers.

DISAGREEMENT IN NUMBER, SUBJECT AND VERB:
Value "True", "Yes", "On" or digit "1" all resolve to true, while "False", "No", "Off" or digit "0" resolve to false.
Singular subject, plural verb ("resolve"): change "or" to "and" in both subjects. The singular disjunctive phrase also disagrees in number with "all." "When all the elements in a series connected by or are singular, the verb they govern is singular: Tom or Jack is coming. Beer, ale, or wine is included in the charge" (American Heritage, English Usage).

COMMA SPLICE: You can apply boolean operators to boolean variables, see Operators section.


I'll pause. That's a sample of grammatical faults, from the first few paragraphs.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Re: To Slaven: corrections to pocoscript.html file

Postby Eric » Thu Sep 07, 2006 8:03 am

MarkB,
MarkB wrote:Slaven, when you revise the definition of PocoVersion in pocoscript.html, if you want to make some other corrections...
Better send those corrections to Support, because Slaven doesn't read every topic here, so your post could get lost in all the rest. :?

Thanks for your work in all this. :)
Eric
 

Re: To Slaven: corrections to pocoscript.html file

Postby MarkB » Thu Sep 07, 2006 8:27 am

Eric wrote:MarkB,
MarkB wrote:Slaven, when you revise the definition of PocoVersion in pocoscript.html, if you want to make some other corrections...
Better send those corrections to Support, because Slaven doesn't read every topic here, so your post could get lost in all the rest. :?

Thanks for your work in all this. :)


Good tip, but I'll wait and let others add their pet peeves.

No work. I'm sitting at home helplessly waiting for the plumber to arrive. And waiting.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Sat May 02, 2009 3:21 am

There's a slight error in the documentation for DeleteLine, which says in part

The following command would be used to delete the 3rd and 4th lines of multi-line variable $x:
DeleteLine $x 3 2


In fact, that command deletes the 4th and 5th lines or line 3 and line 4. Here's a demo:

Code: Select all
Set $a "First line (line 0)\nSecond line (line 1)\nThird line (line 2)\nFourth line (line 3)\nFifth line (line 4)\nSixth line (line 5)"
MessageBox $a
DeleteLine $a 3 2
MessageBox $a
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Mon Jan 18, 2010 5:20 am

The entry for Random says this:

For example, to generate a random number between 1 and 10 you would use:

Random #random 9
Inc #random


Actually, it generates a number between 1 and 9, I think. "Random #random 9" gives an integer greater than or equal to 0 and less than 9 -- that is, between 0 and 8. Add 1 and you get a number between 1 and 9.

Code: Select all
Set #i 0
:LoopLoop
Random #random 9
Inc #random
If #random = 10 Then GotIt
Inc #i
If #i < 5000 Then LoopLoop
MessageBox "No cigar."
Exit
:GotIt
MessageBox "We have a 10!"
Exit
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Mon Jan 18, 2010 7:51 am

The documentation says this about the system variable $PocoVersion:
$PocoVersion = Contains the version info for PocoMail (the same as is displayed in the X-Mailer header).


That is false. Currently, with PocoMail version 4.8.0.4400, $PocoVersion = "3000"; the X-Mailer header = "X-Mailer: Pocomail 4.8 (4400) - Licensed Version".
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Tue Jan 19, 2010 3:50 am

The file should be run through an HTML validator. Here is a sampling of validation errors present.

Line 19 <b><font size="+1">PocoScript Help</b>
Nesting error: the b tags should be inside the font tags or vice versa.

Line 38 <li>When starting PocoMail (see command line parameters</a>)
Extra end tag </a> that should be removed.

Line 111 &gt "a" is true).</p>
Missing semicolon: $gt should be &gt;

Line 647 <p><i><b><a name="ArithmeticOperations">Arithmetic Operations</a></I></b></BlockQuote>
Nesting error: </b> should be inside the <i> tags.

Line 695 The following four commands are all boolean operations and act on boolean variables. In each case the result is placed in the first variable.</p></BlockQuote>
</p> with no opening <p>.

Line 930 The process of branching causes execution to skip from one section of a script to another bypassing all commands in between. Scripts can even branch backwards to form loops, for example:</p>
</p> with no opening <p>.

Line 971 <p><b><font size="+1"><a name="CreateEditScript">Creating and Editing Scripts</b></font><p>
Missing </a> tag.
Nesting error: the b tags should be inside the font tags or vice versa.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Tue Jan 19, 2010 6:17 am

The documentation describes the system variable #PocoVersion as follows:
#PocoVersion = Contains the PocoMail build number.


The actual purpose of #PocoVersion and $PocoVersion changed many years ago. The documentation should be updated. Seriously.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby Tomas » Tue Jan 19, 2010 2:52 pm

Thank you Mark for all your work on this. I'll be looking into it and try to assemble the file and send it to Slaven for inclusion in next build.
Tomas
Tomas
Pillar of the Community
 
Posts: 1418
Joined: Sun Jul 25, 2004 1:34 am

Postby MarkB » Sat Feb 06, 2010 2:40 am

GetRawAddress

Help says
GetRawAddress $a $b $bookname
Finds and places the entry for email address $b from address book $bookname into multi-line variable $a.


That appears to be false -- the data in $a is not multi-line; it's comma-separated.

Code: Select all
GetRawAddress $a "xxxxxxx@yyyyy.ca" "*"
MessageBox $a
LineCount #n $a
MessageBox #n

{ Convert CSV data to multi-line
ReadCSV $t $a
MessageBox $t
LineCount #n $t
MessageBox #n
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Mon Feb 08, 2010 1:45 am

At the bottom of the page is this, which is fubar.

Image
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby MarkB » Wed Feb 17, 2010 3:13 am

The ^ Operator

The description needs to be cleaned up, in my opinion. The first part seems to state that ^ means "is a substring of":
^ Contained within, works practically only on strings. Evaluates true if the first string is contained within the second string. For example "ven" ^ "Slaven" is true.


That seems clear. Then comes this confusing bit
This operator can be used to determine if a variable consists solely of alphabetic characters:
Set &isalpha $test ^ "abcdefghijklmnopqrstuvwxyz"
which seems to say that &isalpha is true if each character in the string $test is contained in the alphabet string. It isn't.

Code: Select all
{  &isalpha is false here
Set $test "we"
Set &isalpha $test ^ "abcdefghijklmnopqrstuvwxyz"
MessageBox &isalpha
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: Exabot [Bot] and 0 guests

cron