Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Can QBasic access COM Ports for I/O?  (Read 3003 times)

0 Members and 1 Guest are viewing this topic.

tlmester

    Topic Starter


    Greenhorn

    Can QBasic access COM Ports for I/O?
    « on: March 26, 2008, 05:28:00 PM »
    Can QBasic access COM Ports for I/O?
           Do I understand QBasic correctly that it cannot OPEN the Computer's COM Ports like the Modem?  Can QBasic activate the Windows Dial-up Box to make a connection to the Internet?  I wanted to be able to write a Program to access my POP Server in order to download Headers, and delete Junk.  Am I going to have to learn C Language to do this?  Thanks for your help.
    ???  :)

    Dusty



      Egghead

    • I could if she would, but she won't so I don't.
    • Thanked: 75
    • Experience: Beginner
    • OS: Windows XP
    Re: Can QBasic access COM Ports for I/O?
    « Reply #1 on: March 26, 2008, 08:19:36 PM »
    QuickBasic cannot natively access ports when running in the NT/XP Command Shell.  There are add-ons to NT/XP/QuickBasic which 'claim' to solve this problem, I have never tried them.

    Quote
    I wanted to be able to write a Program to access my POP Server in order to download Headers, and delete Junk.

    Have you tried free MailWasher - review and download here..

    One good deed is worth more than a year of good intentions.

    tlmester

      Topic Starter


      Greenhorn

      Re: Can QBasic access COM Ports for I/O?
      « Reply #2 on: March 27, 2008, 06:00:42 PM »
      I thank you immensely Dusty.  This is exactly what I need as a Dial-up user.  I do use Mozilla Thunderbird which has an excellent Message Filter setup, but it unfortunately has many Bugs!  The "Size" Condition doesn't work with Message Headers -- which defeats one of the advantages to only downloading Headers.  Thanks to you my life is now simpler with MailWasher.

      Terry Mester
       :) :D ;D 8) ::)

      Dusty



        Egghead

      • I could if she would, but she won't so I don't.
      • Thanked: 75
      • Experience: Beginner
      • OS: Windows XP
      Re: Can QBasic access COM Ports for I/O?
      « Reply #3 on: March 28, 2008, 04:09:57 AM »
      Glad to be of service.  Thanks for coming back at us to report your success.
      One good deed is worth more than a year of good intentions.

      tlmester

        Topic Starter


        Greenhorn

        Re: Can QBasic access COM Ports for I/O?
        « Reply #4 on: March 29, 2008, 08:26:47 PM »
        I'm always happy to conclude a Thread, and not leave it hanging.  I should update the Website Address for the newest Version of MailWasher:  http://www.mailwasher.net.  The PC World Magazine Link is for the old Version 5.

        Glad to be of service.  Thanks for coming back at us to report your success.

        tlmester

          Topic Starter


          Greenhorn

          QBasic vs. C
          « Reply #5 on: March 29, 2008, 08:30:05 PM »
          I've been reviewing the C Language Tutorial on cplusplus.com, and it appears to me that much of C is redundant compared to Basic.  If Basic were the English Language, C looks like Eastern European.  I simply cannot comprehend why the designer of C didn't appropriate Basic's English terminology.  This was a dumb mistake!  As far as I'm aware, C was created as a Language for compiling a Programme into Machine Language code.  Back in the 1980s, there were no compilers for Basic, and programmers actually wrote in Machine Language.  Given the ability to compile QBasic Programmes, I have a few questions regarding Basic vs. C:
          #1 - Is a COMPILED (Machine Language code) Basic Programme any "longer" or "less efficient" than a compiled C Programme?  (e.g. looking at the length of modern software files like MS Windows and Mozilla, C Language doesn't look very efficient.)

          #2 - Can C Language do anything that QBasic cannot?  (I know that there are some limitations to QBasic as noted in my Post above.)

          #3 - Is there a better version of Basic which can do as much as C, and which can be compiled into Machine Language like C?

          I'm really not sure if it's worth me spending my time to learn C++.  I began using a computer 24 years ago when software was compact and efficient.  Now it is bulky, fat and slow!

          Mr. Terry Mester
           ??? ::) :-X

          Dusty



            Egghead

          • I could if she would, but she won't so I don't.
          • Thanked: 75
          • Experience: Beginner
          • OS: Windows XP
          Re: Can QBasic access COM Ports for I/O?
          « Reply #6 on: March 30, 2008, 01:08:53 AM »
          I'll put in my 2-cents worth but don't give any guarantees as to accuracy.

          #1 No.  But how do we judge program efficiency.  Your experience (1980's) was probably in the days when Ram was very expensive so any fat had to be trimmed from programs to make them fit, program efficiency was all important.  Nowadays with zillions of gigs of Ram being so cheap it doesn't really matter if the programmer uses one or a hundred instructions to achieve the same result.  Also, with the vastly improved speed of processors, no-one needs to care how efficient a program is as long as the desired result is achieved!  The major cost in programming today is manpower.

          #2 Yes.  Basic, in all its versions, was written to run in a Dos environment (lets not get into the True-Dos/Emulator argument) so does not take kindly to modern Operating Systems.  C, in all its versions, is fully compatible with most OS's.

          #3 Not to my knowledge (which is limited).  Visual Basic (VB.6, VB.Net etc.) is very good and might be considered as Basic with a Visual add-on.  i.e. one can create windows as well as use the Basic programming commands.  That description is open to all sorts of criticism ;D   BTW QuickBasic is also compiled before running, even in the IDE.

          We mustn't overlook Visual C++ or Visual C#.  Express editions for VB 2008, Visual C++ and Visual C# are available for free download here.  I understand that Express editions are cut-down or lightweight versions of the read thing just to whet your appetite to part with a few dollars for the main attractions. ::) :'( :D

          I have some programming experience with VB and C++ but like to slip back into the dark ages so sometimes use Assembler, Fortran IV and - would you believe it - Cobol.  My preference is for Assembler when the opportunity arises.

          « Last Edit: March 30, 2008, 01:25:16 AM by Dusty »
          One good deed is worth more than a year of good intentions.

          tlmester

            Topic Starter


            Greenhorn

            QBasic vs. C
            « Reply #7 on: March 30, 2008, 07:38:09 PM »
            - would you believe it - Cobol. 
            ;D ;D ;D ;D ;D  I can't believe it Dusty.  ;D ;D ;D ;D ;D I believe COBOL dates back to the 1960s!  ;D ;D ;D ;D ;D
            Seriously however, I fully agree with your line of thinking in not wanting to waste time and brain capacity to learn a new Language when the old ones work perfectly fine.  Personally, I wish that the C Language had never been created simply because there was no reason for it to be created.  The predicate behind C is the "COMPILER" which converts the C code into Machine Language code.  This simplifies computer programming since it is much more burdensome to programme a computer in Machine Language.  However, there was no reason whatsoever why the designers of C couldn't just make their Compiler work with BASIC.  Just imagine how much better off the computer world would be today if they had just designed their Compiler for the Basic Language.  The Line Numbers in Basic make it so much easier to find your way around a programme.  I absolutely hate the fact that C doesn't use Line Numbers which makes no sense whatsoever since, unless I'm mistaken, Machine Language uses Line Numbers!  What were the C designers thinking of?  The lack of Line Numbers results in more programme duplication!  It is also more difficult to diagnose Bugs in C than in Basic.  Just look at the hundreds of thousands of Bug Reports filed with Mozilla.  If you search my name on bugzilla.mozilla.org you'll see the many Bug Reports I've filed -- only one or two of those Bugs have ever been fixed.  I just downloaded Mailwasher a couple days ago, and found Bugs in that too.  I was flabbergasted to find that the V6 downloaded File (at 7.6M) is 120% LARGER than V5 (3.4M).  The increasing size of programmes is almost certainly the fault of C Language, and its failure to use Line Numbers.  This increasing size is a real problem on two fronts.  For people like myself with 128M of Computer RAM Memory, Firefox gobbles up 50.8M to 59.8M of Memory; Thunderbird gobbles 10.1M to 30.2M; and MailWasher consumes 6.8M to 19M!  By comparison Internet Explorer only registers 15M!  This really slows down my Computer, and this is a big issue for people with older Computers.  Programmers should not expect everyone to get a super-duper modern Computer!  Additionally, there is the increasingly serious problem of the "bogging down" of the Internet!  The Internet is expected to have a deficit of transmission capacity within a few years!  These large software programmes being downloaded are causing this.  Even though I only have 50K Dial-up, it actually doesn't take long to download an HTML Webpage.  What takes long with Dial-up is downloading these multiple-Megabyte software programmes.  This is thanks to C and sloppy programmers!  Pretty much everybody can afford the cost of Dial-up which only costs me $18 for 25 Hours which I have 3 months to use up.  I conserve my Internet Time very well, and this 25 Hours lasts me the full 3 months.  Were it not for the amount of time it takes to download Megabytes of software, more people would have Dial-up home Internet service instead of nothing at all.  The frustrations of downloading large software programmes is what causes people to just cancel their Internet service if they can't afford High Speed.  However, once Internet transmission capacity hits a deficit, High Speed is going to seem rather slow -- thanks to C.

            Thanks for the Link to Visual Basic.  I'm going to check it out.  I'd be more than happy to pay for it if its good, and not full of Bugs.  I'd be happy to pay for Mozilla if it weren't full of Bugs, and constantly suffering more Bugs.  It's of course not reasonable to expect people to pay for a programme with Bugs which will never get fixed.

            Terry Mester

            Dusty



              Egghead

            • I could if she would, but she won't so I don't.
            • Thanked: 75
            • Experience: Beginner
            • OS: Windows XP
            Re: Can QBasic access COM Ports for I/O?
            « Reply #8 on: March 31, 2008, 01:12:36 AM »
            That's a real good rant about C ;D  Not sure that you're on the right track but each to his own.

            As to line numbers - well perhaps you're a Goto fan and like to produce spaghetti coding.  Way past time for a move to QuickBasic 4.5 with its inbuilt compiler and forget line numbers.

            Can't recall mentioning that my line of thinking is "not wanting to waste time and brain capacity to learn a new Language when the old ones work perfectly fine.", the outdated languages work well in some, though very few, circumstances and the opportunities to use them are diminishing.

            Good luck.
            One good deed is worth more than a year of good intentions.