Skip to content

Passing a FLOAT to a function with e.g. a BYTE signature #951

@Karl1155

Description

@Karl1155

I m wondering why this code compiles without a warning/error. Trying the same with VO results in: "Possibly dangerous automatic conversion ... 51458"

btw. none of the X# compiler options are set

FUNCTION Start( ) AS VOID
LOCAL f := -1343.345 AS FLOAT  // "AS DOUBLE" throws an compile error

TestFloat ( f ) 

f := 12345673.89

TestFloat ( f ) 

RETURN


FUNCTION TestFloat ( n AS BYTE ) AS INT  
	? n   // shows 193 and 73
	RETURN 0

Karl-Heinz

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions