Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Compiling a Source Code

Compiling a Source Code

Scheduled Pinned Locked Moved Visual Studio
10 Posts 5 Posters 31 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13401082
    wrote on last edited by
    #1

    .

    A L S 3 Replies Last reply
    0
    • U User 13401082

      .

      A Offline
      A Offline
      Afzaal Ahmad Zeeshan
      wrote on last edited by
      #2

      Member 13433022 wrote:

      another person had written for me, since I am not a programmer.

      Then the problem is, you will not understand what we are going to tell you. Thus, it would be best if you can approach them back and tell them that they have a problem with the code. It is obvious and common to have logical bugs, and programmers usually do solve them if the problem was by them (and not a requirement study problem). Lastly, the problem might be with the compiler flags, and the programmer who wrote the program may have a different setup for the compiler. I would again recommend, that you ask them for the procedure, as to how to build the project to test it.

      The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

      1 Reply Last reply
      0
      • U User 13401082

        .

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Tell your friend to use the debugger to see exactly what the two lists contain at the end of the two reading loops.

        U 1 Reply Last reply
        0
        • L Lost User

          Tell your friend to use the debugger to see exactly what the two lists contain at the end of the two reading loops.

          U Offline
          U Offline
          User 13401082
          wrote on last edited by
          #4

          I do not have the contact information of the person. I have compiled the source code in Visual Studio, and no errors were shown. The program starts normally but produces no results. Can you correct the source code so that it may do the task for which it is intended?

          L 1 Reply Last reply
          0
          • U User 13401082

            .

            S Offline
            S Offline
            Sascha Lefevre
            wrote on last edited by
            #5

            Option Strict On
            Option Explicit On
            Option Infer Off

            Imports System.Collections.Generic
            Imports System.IO
            Imports System.Linq
            Imports System.Windows.Forms

            Public Class Form1
            Private Sub _
            Button1_Click(sender As System.Object,
            e As System.EventArgs) _
            Handles Button1.Click

            Dim inputFile1 As String = "C:\\New\\1.txt"
            Dim inputFile2 As String = "C:\\New\\2.txt"
            Dim outputFile As String = "C:\\New\\3.txt"
            
            Dim linesFile1 As IEnumerable(Of String) = File.ReadAllLines(inputFile1).Where(Function(line) Not \[String\].IsNullOrWhiteSpace(line))
            Dim linesFile2 As IEnumerable(Of String) = File.ReadAllLines(inputFile2).Where(Function(line) Not \[String\].IsNullOrWhiteSpace(line))
            
            Dim linesNotInFile2 As String() = linesFile1.Except(linesFile2).ToArray()
            
            File.WriteAllLines(outputFile, linesNotInFile2)
            
            End Sub
            

            End Class

            This should work. I wrote it in C# and had it automatically translated to Visual Basic.

            If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

            M 1 Reply Last reply
            0
            • S Sascha Lefevre

              Option Strict On
              Option Explicit On
              Option Infer Off

              Imports System.Collections.Generic
              Imports System.IO
              Imports System.Linq
              Imports System.Windows.Forms

              Public Class Form1
              Private Sub _
              Button1_Click(sender As System.Object,
              e As System.EventArgs) _
              Handles Button1.Click

              Dim inputFile1 As String = "C:\\New\\1.txt"
              Dim inputFile2 As String = "C:\\New\\2.txt"
              Dim outputFile As String = "C:\\New\\3.txt"
              
              Dim linesFile1 As IEnumerable(Of String) = File.ReadAllLines(inputFile1).Where(Function(line) Not \[String\].IsNullOrWhiteSpace(line))
              Dim linesFile2 As IEnumerable(Of String) = File.ReadAllLines(inputFile2).Where(Function(line) Not \[String\].IsNullOrWhiteSpace(line))
              
              Dim linesNotInFile2 As String() = linesFile1.Except(linesFile2).ToArray()
              
              File.WriteAllLines(outputFile, linesNotInFile2)
              
              End Sub
              

              End Class

              This should work. I wrote it in C# and had it automatically translated to Visual Basic.

              If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              Hah I'd have done the foreach thing, did not occur to me to use linq. Have and upvote

              Never underestimate the power of human stupidity RAH

              S 1 Reply Last reply
              0
              • U User 13401082

                I do not have the contact information of the person. I have compiled the source code in Visual Studio, and no errors were shown. The program starts normally but produces no results. Can you correct the source code so that it may do the task for which it is intended?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Since you are not a programmer there is really no point.

                1 Reply Last reply
                0
                • M Mycroft Holmes

                  Hah I'd have done the foreach thing, did not occur to me to use linq. Have and upvote

                  Never underestimate the power of human stupidity RAH

                  S Offline
                  S Offline
                  Sascha Lefevre
                  wrote on last edited by
                  #8

                  Hehe, thanks :) I frequently have to stop myself from writing screen-long linq-stuff without intermediate results :laugh:

                  If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

                  U 1 Reply Last reply
                  0
                  • S Sascha Lefevre

                    Hehe, thanks :) I frequently have to stop myself from writing screen-long linq-stuff without intermediate results :laugh:

                    If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

                    U Offline
                    U Offline
                    User 13401082
                    wrote on last edited by
                    #9

                    Thank you for writing the code. It works after I compiled it into an .exe file. I understand how the “for” command works, repeating a certain operation a specified number of times. I was not aware of another way to achieve the same result.

                    S 1 Reply Last reply
                    0
                    • U User 13401082

                      Thank you for writing the code. It works after I compiled it into an .exe file. I understand how the “for” command works, repeating a certain operation a specified number of times. I was not aware of another way to achieve the same result.

                      S Offline
                      S Offline
                      Sascha Lefevre
                      wrote on last edited by
                      #10

                      You're welcome :) The methods I used there use (simply speaking) for-loops internally. It moves the ugly repetitive stuff out of sight.

                      If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups