4 Replies - 3532 Views - Last Post: 24 February 2012 - 03:19 PM

#1 Braber01  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 247
  • Joined: 29-November 08

Block Following let is unfinished expect an Expression

Posted 23 February 2012 - 02:32 PM

I'm trying an SPOJ Problem with the ID Test however I need F# Syntax help

open System

    let answer_to_life = 42;
    let mutable count = 0; //Loop Counter

    while count < 5 do
        begin
            let input = Console.ReadLine();  //ERROR OCCURS HERE
            let intInput = Convert.ToInt32(input);
            if intInput <> 42 then Console.WriteLine(intInput) else Console.WriteLine()
            count <- count + 1
        end
    done



Is This A Good Question/Topic? 0
  • +

Replies To: Block Following let is unfinished expect an Expression

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,416
  • Joined: 29-May 08

Re: Block Following let is unfinished expect an Expression

Posted 23 February 2012 - 02:45 PM

It'a usually related to indenting issues, the indentation is similar to Python's

Parent
  Child_1
    Child_2
  Child_1
Parent


Was This Post Helpful? 0
  • +
  • -

#3 sepp2k  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2091
  • View blog
  • Posts: 3,185
  • Joined: 21-June 11

Re: Block Following let is unfinished expect an Expression

Posted 23 February 2012 - 03:13 PM

In this case the error is that you indented the whole contents of the file (except the first line) by 4 spaces. If you remove those, it will compile fine.
Was This Post Helpful? 0
  • +
  • -

#4 Braber01  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 247
  • Joined: 29-November 08

Re: Block Following let is unfinished expect an Expression

Posted 24 February 2012 - 02:44 PM

So if I remove the indentation from the first 2 lets it should compile is that what you're saying?
Was This Post Helpful? 0
  • +
  • -

#5 sepp2k  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2091
  • View blog
  • Posts: 3,185
  • Joined: 21-June 11

Re: Block Following let is unfinished expect an Expression

Posted 24 February 2012 - 03:19 PM

If you remove 4 spaces of indentation from every line, it will work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1