• MPL question

    From Black Panther@21:1/186 to All on Tuesday, June 04, 2019 20:35:23
    Hi All,

    Just a quick question about MPL vs Pascal.

    In FreePascal, I'm able to set up an array of records such as:

    Var data : array[0..15] of record

    Evidently, in MPL, the counting is not zero based, as it will only allow:

    Var data : array[1..15] of record

    If I try using [0..15], I get 'Corrupted memory (216)' errors.

    Anyone else notice this?


    ---

    Black Panther(RCS)
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From xqtr@21:1/111 to Black Panther on Wednesday, June 05, 2019 14:45:44
    In FreePascal, I'm able to set up an array of records such as:
    Var data : array[0..15] of record
    Evidently, in MPL, the counting is not zero based, as it will only allow: Var data : array[1..15] of record
    If I try using [0..15], I get 'Corrupted memory (216)' errors.
    Anyone else notice this?

    I made a simple test script and works fine. Can you post the part of the code that makes this error?

    :: XQTR :: Another Droid BBS :: andr01d.zapto.org:9999 :: xqtr@gmx.com

    --- Mystic BBS v1.12 A43 2019/03/03 (Raspberry Pi/32)
    * Origin: Another Droid BBS # andr01d.zapto.org:9999 (21:1/111)
  • From Black Panther@21:1/186 to xqtr on Wednesday, June 05, 2019 13:36:45
    On 05 Jun 2019, xqtr said the following...

    I made a simple test script and works fine. Can you post the part of the code that makes this error?

    I'm guessing that's why it was giving the error. There are two arrays that
    I'm loading in TDTA. One for weapons, the other for armour.

    type wrec = record
    index : byte
    name : string[20]
    price : LongInt
    strength: integer
    end

    type arec = record
    index : byte
    name : string[20]
    price : LongInt
    strength: integer
    end

    Var
    weapons : Array[1..15] of wrec
    armour : Array[1..15] of arec

    Right now, I'm filling those arrays via a procedure. (I know, it should be in
    a data file... It's on my TODO list)

    procedure setweapons
    Begin
    weapons[1].index:=1
    weapons[1].name:='Stick'
    weapons[1].price:=200
    weapons[1].strength:=5
    weapons[2].index:=2
    etc... etc...

    If I change the array to [0..15], and add lines to fill that record, is when Mystic starts giving me the 216 error

    My thought was to have a minimum 'default' weapon/armour, in case the user sells their stick. Right now, it just shows they have a ' ' weapon/armour.


    ---

    Black Panther(RCS)
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From Gryphon@21:1/120 to Black Panther on Friday, June 07, 2019 15:24:18
    On 04 Jun 2019 &4, Black Panther said the following...

    Hi All,

    Just a quick question about MPL vs Pascal.

    In FreePascal, I'm able to set up an array of records such as:

    Var data : array[0..15] of record

    Evidently, in MPL, the counting is not zero based, as it will only allow:

    Var data : array[1..15] of record

    If I try using [0..15], I get 'Corrupted memory (216)' errors.

    Anyone else notice this?

    Yes, it doesn't work in MPL.

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Cyberia BBS | cyberiabbs.zapto.org | San Jose, CA (21:1/120)
  • From dream master@21:1/163 to Black Panther on Friday, June 07, 2019 16:05:31
    On 04 Jun 2019, Black Panther said the following...
    Evidently, in MPL, the counting is not zero based, as it will only allow: Var data : array[1..15] of record
    If I try using [0..15], I get 'Corrupted memory (216)' errors.
    Anyone else notice this?

    yeah i don't know why he has it this way but for now the [1.. will have to do.

    |08 .|05ú|13ù|15Dr|07e|08am Ma|07st|15er|13ù|05ú|08.
    |08 øù|05ú|13ùø |13øù|05ú|08ùø
    |11 DoRE|03!|11ACiDiC|03!|11Demonic
    |08[|15bbs|09.|15dreamlandbbs|09.|15org|08]

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From Black Panther@21:1/186 to Gryphon on Friday, June 07, 2019 18:58:26
    On 07 Jun 2019, Gryphon said the following...

    Var data : array[0..15] of record

    Evidently, in MPL, the counting is not zero based, as it will only al

    Yes, it doesn't work in MPL.

    That's what I thought. I just wanted to make sure I wasn't messing something
    up on my end... :)

    Thank you.


    ---

    Black Panther(RCS)

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From Black Panther@21:1/186 to dream master on Friday, June 07, 2019 18:59:04
    On 07 Jun 2019, dream master said the following...

    Var data : array[1..15] of record
    If I try using [0..15], I get 'Corrupted memory (216)' errors.
    Anyone else notice this?

    yeah i don't know why he has it this way but for now the [1.. will have
    to do.

    I can work around it. I just thought it was a bit strange... :)

    Thanks,


    ---

    Black Panther(RCS)

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)