Community

SCI Programming => SCI Development Tools => Topic started by: robbo007 on January 13, 2023, 11:20:40 PM

Title: Brackets Bracket and more Brackets errors
Post by: robbo007 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.

Title: Re: Brackets Bracket and more Brackets errors
Post by: mnicolella on January 14, 2023, 12:51:43 AM
It doesn't look like you have a closing bracket for the (method or the (instance
Title: Re: Brackets Bracket and more Brackets errors
Post by: lskovlun 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.
Title: Re: Brackets Bracket and more Brackets errors
Post by: robbo007 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!!
 
Title: Re: Brackets Bracket and more Brackets errors
Post by: Collector 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.