illegal parameter

Using TB Silver

Trying to pass by balue. Error saying illegal paramter.

Is there a problem with the software.

I have used

CALL calculate_data((clockspeed),(dbuswidth))

SUB calculate_data((clockspeed),(dbuswidth))

The program uses clockspeed and dbuswidth only to compare....so they must be passed by value only.

Comments

Thx I can see the mistake

Thx

I can see the mistake now.

Much appreciated.

Illegal Parameter

The problem is that you don't need the parens in the SUB statement, only in the CALL statement.

The following will work:

CALL calculate_data((clockspeed),(dbuswidth))

SUB calculate_data(clockspeed,dbuswidth)

Hi, You don't need brackets

Hi,

You don't need brackets around parameters
e.g.

CALL calculate_data(clockspeed,dbuswidth)

SUB calculate_data(clockspeed,dbuswidth)

Big John

Don't Need Brackets? Yes You Do!

If you do it your way, the parameters are by Reference which will allow them to be changed. This is no good in this case. The OP needs them to be used by Value so they can't be changed. This will do it:

CALL calculate_data((clockspeed),(dbuswidth))

SUB calculate_data(clockspeed,dbuswidth)

By value

Hi Tom,

You are so right. My mistake.

Big John