Click here to Skip to main content
11,706,801 members (44,278 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB6 VB.NET
I have some pcl documents with information embeded in the first couple of lines. These need to be removed bfore converting the pcl document to a tiff document to be imaged.

In vb6 I used:

Put #outFile, , Replace(StrConv(InputB(LOF(fileNum), fileNum), vbUnicode), sString, "", 1, 1, vbBinaryCompare)

I am opening the file binary converting to a string and replacing the string, basically deltting the string and saving it to a new file. I have tried to code this in, but have not been able to make it work.
Posted 25-May-12 7:33am
Edited 25-May-12 7:36am
Maciej Los193.8K
SAKryukov at 25-May-12 14:44pm
Who do you think MSDN help is written for?
losmac at 29-May-12 13:03pm
Good question!

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I found a way to accomplish what I needed.

FileOpen(5, "C:\Temp\TempImg.pcl", OpenMode.Output)
Do Until EOF(fileNum)
    sString1 = LineInput(fileNum)
    position = InStr(sString1, "INDEXX:")
    If position > 0 Then
        sString = sString1
        sString1 = ""
    End If
    Print(5, sString1 & vbCrLf)
imageFile = My.Computer.FileSystem.ReadAllBytes"C:\Temp\TempImg.pcl")
My.Computer.FileSystem.WriteAllBytes(TempDir + sFileName, imageFile, False)
Kenneth Haugland at 16-Jul-12 12:20pm
This looks a lot like VB6 if im not mistaken?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 156
1 Sergey Alexandrovich Kryukov 155
2 chainerlt 110
3 ppolymorphe 91
4 Mika Wendelius 70
0 OriginalGriff 9,190
1 Sergey Alexandrovich Kryukov 8,407
2 CPallini 5,189
3 Maciej Los 4,756
4 Mika Wendelius 3,686

Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 29 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100