# Brackets { } .........

Steve Jensen

Ranch Hand

Posts: 126

posted 13 years ago

- 0

I've been typing in examples from a chapter on Methods, and I thought I understood what was going on.

Until now.

My problem concerns the use of brackets { } when writing code.

Below is what I thought the solution to a factorial problem - this is my solution. Well, when I say 'my' solution, I mean the book code, but with as much of it as possible anticipated by me and written, only looking at the book when stuck.

There is a syntax error in it, and for the life of me, I can't figure out where it is.

Below is the book solution, which compiles and runs fine.

I think there error in my solution lies in the use of the { } brackets.

Can anybody see what I've done wrong, and why?

I have spent HOURS breaking my thumbs trying to figure it out, but to no avail.

Until now.

My problem concerns the use of brackets { } when writing code.

Below is what I thought the solution to a factorial problem - this is my solution. Well, when I say 'my' solution, I mean the book code, but with as much of it as possible anticipated by me and written, only looking at the book when stuck.

There is a syntax error in it, and for the life of me, I can't figure out where it is.

Below is the book solution, which compiles and runs fine.

I think there error in my solution lies in the use of the { } brackets.

Can anybody see what I've done wrong, and why?

I have spent HOURS breaking my thumbs trying to figure it out, but to no avail.

John Bonham was stronger, but Keith Moon was faster.

Ashish Hareet

Ranch Hand

Posts: 375