Show/Hide Toolbars

XSharp

Untyped parameter '{0}' and '{1}' calling convention, assuming 'USUAL' type.

 

This error will be generated by code such as the following:

 
FUNCTION Test1(c as string, i ) as string // warning XS9118: Untyped parameter 'i' and 'STRICT' calling convention, assuming 'USUAL' type.
  return c

Omitting the type of other parameters is allowed, because in that case this parameter will get the same type as the parameter following it. In the sample below both c and i will be of type int.

FUNCTION Test2(c, i as int) as string
  return c

If you omit all types such as in the code below

FUNCTION Test3(c, i ) as string
  return c

then the compiler will generate a function (or method) of CLIPPER calling convention. All parameters will be of type USUAL then and all parameters are optional. You can call this function with as many parameters as you like. Of course you need to write code inside the function to check if the parameters and their types are corrected.

When processing the CLIPPER calling convention, the X# compiler will generate a new PARAMS parameter of type USUAL[] and will create locals for each of the declared parameters and will assign the right element from the PARAMS array into the local variables.