.Net Data Conversioncharacter to ANSI value

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hey all

Have been unable to find the answer I'm looking for, as everyone seems
to want to convert codes to letters, not the other way round.

Am trying to work out how to do in VB.Net the equivient of ASC("S") in VB6.

Fiddled with the Encode and Convert stuff, but to no avail. Any info
apprieciated.


Paul
 
Asc is still there.
Convert will work too, but you need to make sure it understands that you
have a char and not string parameter:
Dim b as Byte = Convert.ToByte(CType("S", Char))
 
Was attempting th steer clear of VB6 Depencancy calls - is AcsW independant?

Managed to work out the convert one in the end (though someone else
posted it - thanks)


Thanks all

Paul
 
It's a VB-only thing, as I understand it, but I don't see any reason for it
to go away (any more than VB, anyway).

Paul T.
 
Hmm.. will stick to .net calls then as it just means another DLL to faff
with otherwise...

No pint in writing new calls and everyone sticks to old one with
dependancy requirements..
It's a VB-only thing, as I understand it, but I don't see any reason for it
to go away (any more than VB, anyway).

Paul T.

Was attempting th steer clear of VB6 Depencancy calls - is AcsW
independant?

Managed to work out the convert one in the end (though someone else
posted it - thanks)


Thanks all

Paul

Paul G. Tobey [eMVP] wrote:

You can use Asc (or, more likely, AscW), in VB.NET...

Paul T.



Hey all

Have been unable to find the answer I'm looking for, as everyone seems
to want to convert codes to letters, not the other way round.

Am trying to work out how to do in VB.Net the equivient of ASC("S") in

VB6.


Fiddled with the Encode and Convert stuff, but to no avail. Any info
apprieciated.


Paul
 
If I compile a DLL with ASC() in it, there is a requirement to have
references in the consuming application, or have the VB namespace dll
registered somewhere (either that or my machine went screwy when I was
doing stuff).
Compiling the DLL without VB6 commands does not generate the additional
VB6 DLL.... Does that mean I'm missing an understanding and the DLL and
consuming app functions fine, and the VB6 DLL is not on the PDA..

Paul
 
The reference to the Microsoft.VisualBasic.DLL is generated automatically
when you create a new VB.NET project. I have not tried to remove it, but
suspect that VB project will not compile without it. Anyway, since this dll
is a part of Compavct Framework, it is already on the device - your
application does not grow larger just because it is using it
 
Back
Top