• may have a bug in mpl OR statement

    From dream master@21:1/163 to g00r00 on Tue Dec 19 21:39:18 2017
    while testing a mpl
    i wrote "auto message with different color output"we
    found that the OR statement only works on the first condition and n
    ot therest.see code below:begin
    if paramcount < 1 then begin writeln('ACiDiC Auto Message
    Mpl'); writeln('invalid command-line. notify sysop
    '); writeln(''); writeln('example dm-auto o
    utput_color|DE|DE|DE'); writeln(''); writeln('
    choices are purple blue green red'); HALT;
    endpc := upper(paramstr(1));if not pc = 'PURPLE' or pc = '
    BLUE' or pc = 'GREEN' or pc = 'RED' thenbegin writel
    n('invalid parameter choices are purple blue green
    red|DE|DE'); halt;endsdate := datestr(datetime,1); dispfile('automsg2');change_msg;endi just want
    ed to see if any one else could reproduce this issue..
    .úùDream Masterùú
    . øùúùøøùúùø
    DoRE!ACiDiC!Demonic[dream
    land.darktech.org]
    --- Mystic BBS v1.12 A36 2017/12/03 (Windows/64)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From Pequito@21:1/126 to dream master on Tue Dec 19 23:29:32 2017
    On 12/19/17, dream master said the following...

    while testing a mpl i wrote "auto message with different color output"

    we found that the OR statement only works on the first condition and not rest.

    see code below:

    I can confirm this when using an or statement it only picks the 1st and
    nothing after it, I had been substituting this with case statements instead.

    Cheers!
    Pequito

    --- Mystic BBS v1.12 A37 2017/12/16 (Linux/64)
    * Origin: Twinkle BBS # (21:1/126)
  • From xqtr@21:1/111 to dream master on Wed Dec 20 11:38:42 2017
    if not pc = 'PURPLE' or pc = 'BLUE' or pc = 'GREEN' or pc = 'RED' then
    Use parenthesis... it happens in FPC also.

    DO it like this:
    if ((not pc = 'PURPLE') or (pc = 'BLUE') or (pc = 'GREEN') or (pc = 'RED')) then

    Haven't test it, but it should work.

    .----- --- -- -
    | Another Droid BBS
    : Telnet : andr01d.zapto.org:9999 [UTC 11:00 - 20:00]
    . Contact : xqtr.xqtr@gmail.com

    --- Mystic BBS v1.12 A34 (Raspberry Pi/32)
    * Origin: Another Droid BBS (21:1/111)
  • From dream master@21:1/163 to xqtr on Wed Dec 20 23:37:38 2017
    On 12/20/17, xqtr said the following...
    if not pc = 'PURPLE' or pc = 'BLUE' or pc = 'GREEN' or pc = 'RED' the
    Use parenthesis... it happens in FPC also.
    DO it like this:
    if ((not pc = 'PURPLE') or (pc = 'BLUE') or (pc = 'GREEN') or (pc = 'RED')) then

    oddly enough i suggested doing this but was tired. lol let me see that
    happens will get back to ya. thanks

    |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[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A36 2017/12/03 (Windows/64)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From dream master@21:1/163 to xqtr on Wed Dec 20 23:41:32 2017
    On 12/20/17, xqtr said the following...
    if not pc = 'PURPLE' or pc = 'BLUE' or pc = 'GREEN' or pc = 'RED' the
    Use parenthesis... it happens in FPC also.
    DO it like this:
    if ((not pc = 'PURPLE') or (pc = 'BLUE') or (pc = 'GREEN') or (pc = 'RED')) then
    Haven't test it, but it should work.

    nope that did not work sadly :( but thanks anyways. hope g00r00 will see the post.

    |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[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A36 2017/12/03 (Windows/64)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From g00r00@21:1/108 to dream master on Thu Dec 21 11:53:30 2017
    we found that the OR statement only works on the first condition and not rest.

    I responded to this in 0net but I'll respond here too in case you haven't
    seen it.

    pc := upper(paramstr(1));
    if not pc = 'PURPLE' or pc = 'BLUE' or pc = 'GREEN' or pc = 'RED' then

    This appears to be a programming logic error not a bug in Mystic. You are only adding NOT to the first condition. You need to use parenthesis when you want to negate an entire list of conditions:

    if not (pc = 'purple' or pc = 'blue') then

    Or you could also do:

    if pc <> 'purple' and pc <> 'blue' and pc <> 'green' then

    --- Mystic BBS v1.12 A37 2017/12/20 (Windows/32)
    * Origin: Sector 7 [Mystic BBS WHQ] (21:1/108)
  • From dream master@21:1/163 to g00r00 on Thu Dec 21 12:48:04 2017
    On 12/21/17, g00r00 said the following...
    we found that the OR statement only works on the first condition and rest.
    I responded to this in 0net but I'll respond here too in case you haven't seen it.
    This appears to be a programming logic error not a bug in Mystic. You
    are only adding NOT to the first condition. You need to use parenthesis when you want to negate an entire list of conditions:
    if not (pc = 'purple' or pc = 'blue') then
    Or you could also do:
    if pc <> 'purple' and pc <> 'blue' and pc <> 'green' then

    ok i will give it a try. i did attempt (pc = 'purple) or (pc='blue) then but that didnt work because it was not the entire list. will get back to ya

    |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[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A36 2017/12/03 (Windows/64)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From dream master@21:1/163 to g00r00 on Thu Dec 21 12:56:18 2017
    On 12/21/17, g00r00 said the following...
    This appears to be a programming logic error not a bug in Mystic. You
    are only adding NOT to the first condition. You need to use parenthesis when you want to negate an entire list of conditions:
    if not (pc = 'purple' or pc = 'blue') then
    if pc <> 'purple' and pc <> 'blue' and pc <> 'green' then

    this work the first one. i am gonna try the second one too.

    |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[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A36 2017/12/03 (Windows/64)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)