Re: VB.Net 2005
* "Jeff Johnson [MVP: VB]" <i.get@enough.s pam> scripsit:[color=blue]
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
> news:OuPHSxwaEH A.524@TK2MSFTNG P09.phx.gbl...
>[color=green]
>> MyShort = MyShort And ValueOf( c )[/color]
>
> Is ValueOf() somthing you wrote yourself? I looked in MSDN and the only
> place I could find this was under JScript[.NET].[/color]
It's pseudo code, or in other words, a method that takes a string
consisting of "0" and "1" characters. 'ValueOf' would return its
integer value.
Still, performance will be bad, especially for longer strings. Natively
supporting binary number /literals/ that are converted at compile-time
would be a far better approach.
Currently, you can use this code to get the behavior of 'ValueOf':
\\\
Public Function ValueOf(ByVal BinaryString As String) As Integer
Return Convert.ToInt32 (BinaryString, 2)
End Function
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
* "Jeff Johnson [MVP: VB]" <i.get@enough.s pam> scripsit:[color=blue]
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
> news:OuPHSxwaEH A.524@TK2MSFTNG P09.phx.gbl...
>[color=green]
>> MyShort = MyShort And ValueOf( c )[/color]
>
> Is ValueOf() somthing you wrote yourself? I looked in MSDN and the only
> place I could find this was under JScript[.NET].[/color]
It's pseudo code, or in other words, a method that takes a string
consisting of "0" and "1" characters. 'ValueOf' would return its
integer value.
Still, performance will be bad, especially for longer strings. Natively
supporting binary number /literals/ that are converted at compile-time
would be a far better approach.
Currently, you can use this code to get the behavior of 'ValueOf':
\\\
Public Function ValueOf(ByVal BinaryString As String) As Integer
Return Convert.ToInt32 (BinaryString, 2)
End Function
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Comment