Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS-DOS ascii character set

Status
Not open for further replies.

JeanMatagne

Programmer
Jan 28, 2000
1
BE
I have to use in a VB6 application, files created under DOS. These files contains ascii character &gt; 127 ( in fact special characters like &quot;éàç&quot; etc.<br>
In visual foxpro when xBase file are opened, it is asked the codepage that has been used to create the files ( MS-DOS, Windows, ...) so the field are displayed correctly<br>
Is there an easy way to convert the value of the string read from the file. ( By easy way, I mean not read character by character and perform character substitution but if possible something like what happen in Foxpro<br>
<br>
Thanks for the help
 
Did you try to import it<br>
Click &quot;File&quot; menu<br>
Click &quot;Get External Data&quot; ,Import<br>
I don't have one to test it.<br>
Does FoxPro convert these characters or do you just want to see them.<br>
What is the end result of what your doing.<br>
Access will most likely do it.<br>
But there is that slim chance it won't.<br>
<br>
<br>

 
Sorry I got confused there<br>
I'm forgot I was in the VB forum<br>
I think you will have to right code to do this.<br>
VB does not really have automatic things like FoxPRO or Access does.<br>

 
Sub StdOut(ByVal Text As String)<br>
<br>
Dim a As Long<br>
Dim L As Long<br>
<br>
If Len(Text) &lt; 1 Then Exit Sub<br>
<br>
'Convert unicode to ansi.<br>
ReDim ByteBuffer(0 To Len(Text)) As Byte<br>
<br>
For a = 1 To Len(Text)<br>
ByteBuffer(a) = Asc(Mid$(Text, a, 1))<br>
Next a<br>
<br>
WriteConsole hConsOutput, ByVal VarPtr(ByteBuffer(1)), UBound(ByteBuffer), L, ByVal 0&<br>
<br>
End Sub <p>Eric De Decker<br><a href=mailto:vbg.be@vbgroup.nl>vbg.be@vbgroup.nl</a><br><a href= Basic Center</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top