H
Herfried K. Wagner [MVP]
* Cor Ligthert said:Again why? Because sometimes to much is no benefit, it can make simple
things suddenly more difficult. Example OR and ELSE.
I am not against binary integer number literals...
* Cor Ligthert said:Again why? Because sometimes to much is no benefit, it can make simple
things suddenly more difficult. Example OR and ELSE.
No it's Pseudo code.
I just throught in which situations binary number literals would make
* "Jay B. Harlow said:I like the term "binary number literals" better then my "binary
constants"...
Herfried K. Wagner said:* "Jeff Johnson said:"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
MyShort = MyShort And ValueOf( c )
Is ValueOf() somthing you wrote yourself? I looked in MSDN and the only
place I could find this was under JScript[.NET].
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
///
Dennis D. said:I believe one of the rules of higher level languages is that the higher
level language 'must' accomodate all objects found in the lower level
languages (here: assembly). Keep in mind this code is used primarily by
machines, not by humans.
The Machine Imperatives
http://www.dennisys.com/
Herfried K. Wagner said:* "Jeff Johnson said:"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
MyShort = MyShort And ValueOf( c )
Is ValueOf() somthing you wrote yourself? I looked in MSDN and the only
place I could find this was under JScript[.NET].
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
///
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.