Author Topic: Brackets Bracket and more Brackets errors  (Read 1514 times)

0 Members and 1 Guest are viewing this topic.

Offline robbo007

Brackets Bracket and more Brackets errors
« on: January 13, 2023, 11:20:40 PM »
Hi guys,
Sorry for the n00b questions. I've assigned some time to try and learn SCI0 using SciStudio 3.0. I've been going through the tutorials that are online and having some issues with testing the said command.

Code: [Select]
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
        (super:handleEvent(pEvent))

(if (Said 'look>')
  (if (Said '/door')
    (Print {The door is blue!})
  else
    (if (Said '/tree')
      (Print {The tree is bright green!})
    else
      (if (Said '[ /* , !* ]')
        (Print {You are in an empty room.})
      )
    )
  )
)
; Cond version
(if (Said 'look>')
  (cond
    ((Said '/door')
      (Print {The door is blue!})
    )
    ((Said '/tree')
      (Print {The tree is bright green!})
    )
    ((Said '[ /* , !* ]')
      (Print {You are in an empty room.})
    )
  )
)

I'm getting the error: Out bracket (')') expected.

I've looked through the code but can't see where the closing bracket is needed? Any help much appreciated.




Offline mnicolella

Re: Brackets Bracket and more Brackets errors
« Reply #1 on: January 14, 2023, 12:51:43 AM »
It doesn't look like you have a closing bracket for the (method or the (instance

Offline lskovlun

Re: Brackets Bracket and more Brackets errors
« Reply #2 on: January 14, 2023, 01:56:21 AM »
Shouldn't you be using Companion instead? The Studio compiler and language were horribly broken... and there's an alternative now.

Offline robbo007

Re: Brackets Bracket and more Brackets errors
« Reply #3 on: January 14, 2023, 02:54:20 AM »
I did try to closed brackets on instance and method but I get different errors when doing that.

SciCompanion seems to show the same error. Its confusing as there is no line number to know where the code is bad and where the missing bracket should go.

doh!!
 

Offline Collector

Re: Brackets Bracket and more Brackets errors
« Reply #4 on: January 14, 2023, 05:21:42 AM »
Ctl+G will bring up the go to dialog to take you to the right line number.
KQII Remake Pic


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.029 seconds with 23 queries.