PC Review


Reply
Thread Tools Rate Thread

Can't use Option Strick On

 
 
active
Guest
Posts: n/a
 
      17th Feb 2007
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







 
Reply With Quote
 
 
 
 
Michael D. Ober
Guest
Posts: n/a
 
      18th Feb 2007
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.

" active" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>
>
>
>
>
>




 
Reply With Quote
 
active
Guest
Posts: n/a
 
      18th Feb 2007
I'll try that

thanks

"Michael D. Ober" <obermd.@.alum.mit.edu.nospam> wrote in message
news:VOMBh.2793$_(E-Mail Removed)...
> 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.
>
> " active" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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
>>
>>
>>
>>
>>
>>
>>
>>

>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Word.Application with Option Strick On active Microsoft VB .NET 4 27th Feb 2007 09:52 PM
Binding Values from a Table to Option Buttons contained in an Option Group faerewing@gmail.com Microsoft Access 3 15th Jan 2007 10:01 PM
Option Commands (Option Explicit / Option Base etc) - Scope Alan Microsoft Excel Programming 8 1st Nov 2004 02:22 AM
Sleep button option hide in power option properties =?Utf-8?B?RXJhcmQgRGF2aWQ=?= Windows XP General 3 29th Jun 2004 03:11 PM
making option groups visible/invisible based on another option group selection Emma Microsoft Access Forms 3 24th Jun 2004 05:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:58 AM.