Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If it has syntax, it isn't user friendly.


computers / alt.bbs.mystic / MPL Strings

SubjectAuthor
* MPL StringsBlack Panther
+* Re: MPL StringsShaun Buzza
|`- MPL StringsBlack Panther
`* Re: MPL Stringsg00r00
 `* MPL StringsBlack Panther
  `- Re: MPL Stringsg00r00

1
MPL Strings

<1648248745@f3.n317.z1.fidonet.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=1121&group=alt.bbs.mystic#1121

  copy link   Newsgroups: alt.bbs.mystic
Path: i2pn2.org!i2pn.org!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.B...@f3.n317.z1.fidonet.org (Black Panther)
Newsgroups: alt.bbs.mystic
Subject: MPL Strings
Date: Fri, 25 Mar 2022 16:49:08 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <1648248745@f3.n317.z1.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="13019"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-Comment-To: g00r00
X-MailConverter: SoupGate-Win32 v1.05
 by: Black Panther - Fri, 25 Mar 2022 04:49 UTC

Hello g00r00!

Just a quick question for you. I know that strings in MPL are 255 characters,
but is there a way to have a string that is longer?

The reason I'm asking, is I wrote a function that will take a text string, and
wrap the text to the users terminal size. The problem I'm running into, is with
the larger screen sizes, 255 characters isn't much longer than the screen.

Would it be possible to have something like an ansistring in MPL, or would that
cause issues with the memory limits of MPL?

Thanks,

Black Panther

.... Trap $C0FFEE, insert coffeemachine to reboot

Re: MPL Strings

<3682840545@f110.n229.z1.fidonet.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=1122&group=alt.bbs.mystic#1122

  copy link   Newsgroups: alt.bbs.mystic
Path: i2pn2.org!rocksolid2!news.neodome.net!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.S...@f110.n229.z1.fidonet.org (Shaun Buzza)
Newsgroups: alt.bbs.mystic
Subject: Re: MPL Strings
Date: Fri, 25 Mar 2022 22:55:32 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <3682840545@f110.n229.z1.fidonet.org>
References: <1648248745@f3.n317.z1.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="15947"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-Comment-To: Black Panther
X-MailConverter: SoupGate-Win32 v1.05
 by: Shaun Buzza - Fri, 25 Mar 2022 10:55 UTC

BP> Just a quick question for you. I know that strings in MPL are 255
BP> characters, but is there a way to have a string that is longer?
BP>
BP> The reason I'm asking, is I wrote a function that will take a text
BP> string, and wrap the text to the users terminal size. The problem I'm
BP> running into, is with the larger screen sizes, 255 characters isn't much
BP> longer than the screen.
BP>
BP> Would it be possible to have something like an ansistring in MPL, or
BP> would that cause issues with the memory limits of MPL?

Isn't 255 the limit for string size in all versions of Pascal? Yeah, I know MPL
isn't exactly Passcal, but I would assume that it is constrained by the limits
of Pascal itself...

McDoob
SysOp, PiBBS
pibbs.sytes.net

.... Message encrypted: Press ALT-F4 to read encoded message

MPL Strings

<1648265421@f3.n317.z1.fidonet.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=1123&group=alt.bbs.mystic#1123

  copy link   Newsgroups: alt.bbs.mystic
Path: i2pn2.org!rocksolid2!news.neodome.net!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.B...@f3.n317.z1.fidonet.org (Black Panther)
Newsgroups: alt.bbs.mystic
Subject: MPL Strings
Date: Fri, 25 Mar 2022 21:25:16 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <1648265421@f3.n317.z1.fidonet.org>
References: <3682840545@f110.n229.z1.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="16919"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-Comment-To: Shaun Buzza
X-MailConverter: SoupGate-Win32 v1.05
 by: Black Panther - Fri, 25 Mar 2022 09:25 UTC

Hello Shaun!

25 Mar 22 22:55, you wrote to me:

SB> Isn't 255 the limit for string size in all versions of Pascal? Yeah, I
SB> know MPL isn't exactly Passcal, but I would assume that it is
SB> constrained by the limits of Pascal itself...

At least in Free Pascal, there is a string type called AnsiString, which has no
length limit. The string is null terminated, and is actually treated as a
pointer to memory on the heap.

There actually is a length limit, but it's dependent on the operating system
and the amount of memory the computer has.

I really only need a string that would be able to hold around 500 or so
characters. I wonder if I could do that with an array of char... Hmmm

Black Panther

.... Necrophiliacs DO IT until they are dead tired.

Re: MPL Strings

<757148116@f215.n129.z1.fidonet.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=1125&group=alt.bbs.mystic#1125

  copy link   Newsgroups: alt.bbs.mystic
Path: i2pn2.org!i2pn.org!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.g...@f215.n129.z1.fidonet.org (g00r00)
Newsgroups: alt.bbs.mystic
Subject: Re: MPL Strings
Date: Sat, 26 Mar 2022 11:49:07 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <757148116@f215.n129.z1.fidonet.org>
References: <1648248745@f3.n317.z1.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="29626"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-MailConverter: SoupGate-Win32 v1.05
X-Comment-To: Black Panther
 by: g00r00 - Fri, 25 Mar 2022 23:49 UTC

BP> Just a quick question for you. I know that strings in MPL are 255
BP> characters, but is there a way to have a string that is longer?

Your options for now are to use Mystic's Python integration or you can try
using the MysticScript which does allow longer strings (available in the
pre-alpha releases of A47 and A48). Otherwise I think you'd have to to use
multiple strings or an array of chars in MPL.

MPL was created in the 1990s and is missing a few crucial things most notably
are 64-bit integers and an ansistring-like type. I may add them in the future
but its going to be a bunch of work, so I am experimenting with MysticScript as
a possible replacement instead.

I haven't fully decided on which direction to go but you can find MS in the A48
pre-alphas. The latest version includes Blackjack, Tetris, and the Usage
ported to MysticScript.

.... APPLE: It may be slow, but at least it's expensive.

MPL Strings

<1648362020@f3.n317.z1.fidonet.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=1132&group=alt.bbs.mystic#1132

  copy link   Newsgroups: alt.bbs.mystic
Path: i2pn2.org!i2pn.org!news.neodome.net!xmission!news.snarked.org!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.B...@f3.n317.z1.fidonet.org (Black Panther)
Newsgroups: alt.bbs.mystic
Subject: MPL Strings
Date: Sun, 27 Mar 2022 00:18:08 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <1648362020@f3.n317.z1.fidonet.org>
References: <757148116@f215.n129.z1.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="11332"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-Comment-To: g00r00
X-MailConverter: SoupGate-Win32 v1.05
 by: Black Panther - Sat, 26 Mar 2022 12:18 UTC

Hello g00r00!

26 Mar 22 11:49, you wrote to me:

BP>> Just a quick question for you. I know that strings in MPL are 255
BP>> characters, but is there a way to have a string that is longer?

gr> Your options for now are to use Mystic's Python integration or you can
gr> try using the MysticScript which does allow longer strings (available
gr> in the pre-alpha releases of A47 and A48). Otherwise I think you'd
gr> have to to use multiple strings or an array of chars in MPL.

That's kinda what I was thinking, but figured it didn't hurt to ask. ;)

gr> I haven't fully decided on which direction to go but you can find MS
gr> in the A48 pre-alphas. The latest version includes Blackjack, Tetris,
gr> and the Usage ported to MysticScript.

I might have to take a look at MS. Is the syntax similar to MPL? I guess if I
took a look, I would be able to find out for myself... <smack> :)

Thank you!

Black Panther

.... Civil engineers do it in the dirt.

Re: MPL Strings

<1809954085@f215.n129.z1.fidonet.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=1137&group=alt.bbs.mystic#1137

  copy link   Newsgroups: alt.bbs.mystic
Path: i2pn2.org!rocksolid2!news.neodome.net!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.g...@f215.n129.z1.fidonet.org (g00r00)
Newsgroups: alt.bbs.mystic
Subject: Re: MPL Strings
Date: Mon, 28 Mar 2022 11:32:49 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <1809954085@f215.n129.z1.fidonet.org>
References: <1648362020@f3.n317.z1.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="11804"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-MailConverter: SoupGate-Win32 v1.05
X-Comment-To: Black Panther
 by: g00r00 - Sun, 27 Mar 2022 23:32 UTC

BP> I might have to take a look at MS. Is the syntax similar to MPL? I guess
BP> if I took a look, I would be able to find out for myself... <smack> :)

Yes, it is Pascal-like and it has a lot of new language features too like
significantly better array handling, pointers, inheritance, overloading, no
string limitations, default parameters, 64 bit integers, etc.

You can use usage.mps and usage.ms in the latest A48 build to compare how close
the code is. I can also give you this too (but keep in mind I am not 100% sure
I will use MS or not yet as the future MPL):

DIFFERENCES FROM TURBO/FREEPASCAL/MPL
=====================================

-- Boolean evaluations must be surrounded in parenthesis. This works the same
as Turbo/Free Pascal but different than MPL. In MPL allows multiple
evaluations to be defined without parenthesis like so:

MPL: If Deck[6].Card = CardJack or Deck[7].Card = CardJack Then

Mystic Script/Turbo/FreePascal:

If (Deck[6].Card = CardJack) or (Deck[7].Card = CardJack) Then

-- Function results must be assigned to "Result" not function name

Many Pascal compilers assign function results to the result variable not
the function name as in Turbo Pascal and MPL. For example:

TurboPascal/MPL:

Function MyFunction : Byte;
Begin
MyFunction := 10;
End;

FreePascal/Delphi/Mystic Script:

Function MyFunction : Byte;
Begin
Result := 10;
End;

-- Case statements "Else" does not have an "assumed Begin/End"

Turbo Pascal:

Case 1 of
2: WriteLn('2');
Else
// Single statement here or multiple statements in Turbo Pascal are okay

WriteLn('Case else');
WriteLn('Value is not 2');
End

Mystic Script:

Case 1 of
2: WriteLn('2');
Else
// Single statement here is okay, but you must enclose multiple statements
// in a begin/end like this:
Begin
WriteLn('Case else');
WriteLn('Value is not 2');
End;
End;

-- Case statements function with string values now:

MyString := 'Hello';

Case MyString of
'Hello': WriteLn('Hello to you!');
End;

This would cause a syntax error in FreePascal or TurboPascal but it works
in Mystic Script.

-- Semi-colons as statement enders are stricter in Mystic Script. MPL and
even Free Pascal is not as strict, so when porting code you may need to add
in some semicolons that you missed in your source code. You need to have
the period after End. in your main program block to signify the end of the
script, etc. There is no compilation so it is more strict with its syntax.

-- When defining default values for records or arrays they must be enclosed in
brackets ([]) instead of parenthesis.

Turbo Pascal:

MyArray : Array[1..4] of Byte = (1,2,3,4);
Mystic Script:

MyArray : Array[1..4] of Byte = [1,2,3,4];

-- Default values for a record do not require the element name. Values should
be defined in order of appearance within the record:

Type
MyRec = Record
A : Byte;
B : Byte;
End;

Turbo Pascal:

Var R: MyRec = (A:0; B:0);
Mystic Script:

Var R: MyRec = [0,0];

-- Multi-dimensional arrays are not declared with TurboPascal shortcuts:

Mystic Script:

Var Grid: Array[1..40] of Array[1..40] of Byte;
TurboPascal/MPL:
Var Grid: Array[1..40, 1..40] of Byte;

-- String types are not limited to 255 characters in Mystic Script.

-- Shutdown must abort script exection.

In MPL scripts will automatically terminal when a shutdown happens but this
convience comes at the expense of being able to handle a shutdown event such
as a user disconnection.

Mystic Script works similar to Mystic Python in that the shutdown event
must be tested for and your script must exit when it is True. This means
that all types of input that would stop the script must be enclosed in a
test for Shutdown. For example:

Repeat
Write ('Menu Prompt (Q/Quit): ');

Case (Readkey) of
'Q' : Break;
End;
Until Shutdown;

// We get here when the user presses Q or Shutdown is True

.... Help! I can't find the "ANY" key.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor