Can't use Option Strick On

  • Thread starter Thread starter active
  • Start date Start date
A

active

When I try to code with Option Strict On I run into obstacles.

As a simple example, trying to read into a structure.

Below "List" is a structure that has been written to a file and now I'd like
to read it back.

FileGet(FileNum, List, ItemPos + 1)

I get

Option Strict On disallows narrowing from type 'System.ValueType' to type
'AddressesInStruct' in copying the value of 'ByRef' parameter 'Value' back
to the matching argument.

There does not seem to be any way to read a structure from a file with
Option Strict On



Is there?



thanks
 
Use Option Strict On. What's it telling you is that it won't allow an
implicit conversions that cannot be verified by the compiler. If you are
positive about the conversion, use CType(obj, <type>).

Mike Ober.
 
I'll try that

thanks

Michael D. Ober said:
Use Option Strict On. What's it telling you is that it won't allow an
implicit conversions that cannot be verified by the compiler. If you are
positive about the conversion, use CType(obj, <type>).

Mike Ober.
 
Back
Top