Spinroot

A forum for Spin users

You are not logged in.

#1 2012-08-08 22:40:40

HJW
Member
Registered: 2012-03-28
Posts: 9

Error: place initialized var decl of...

Hi, I keep getting this error message and don't know why or how to solve the problem:

Error: place initialized var decl of 'ia' at start of proctype     saw ';' near 'byte'

The code looks like this:
...
proctype agent (byte index) {
....
}

init{
...
byte ia = 1;
...
atomic {
        run agent(ia);
}
}
ia is a byte value that gives the process an index in a global array. From the error message I get that it is not initialized propperly. But I don't see why. Any idea what I'm doing wrong?

Thanks in advance for any clues

Offline

#2 2012-08-09 03:39:49

spinroot
forum
Registered: 2010-11-18
Posts: 694
Website

Re: Error: place initialized var decl of...

The error message says that the declaration of an initialized variable must appear at the start of the ini or proctype -- did you try moving it there?

Offline

Board footer

Powered by FluxBB