Results 1 to 4 of 4

Thread: COMM_Open never sets Err

  1. #1

    COMM_Open never sets Err

    The help says that COMM_Open() will set Err to some value if there is an error detected when opening a com port.

    I'm running Windows 7 64 bit, and no matter which com port I try to open, I always see the Err is 0 after COMM_Open(), no matter if the port exists or if it doesn't exists.

    Shouldn't there be some way to tell if the COMM_Open() call failed? In other words, if you try to open a non-existent COM port?

    No matter what number I have for sComPort, this line of code
    COMM_Open("\\.\COM" & sComPort, hComm)

    doesn't seem to do anything to the Err value of 0.

    Thanks-

    *Brian

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Can you please try the attached updated module?
    Just unzip thinBasic_COMM.DLL into your \thinbasic\Lib\ replacing your cuurrent one.

    I've updated COMM_OPEN to return a value (error code).
    If something goes wrong a value different from ZERO should return
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Yes! That works just great. Does the returned error code have any meaning other than "not zero"?

    Don't forget to update the help file with this most useful information if you choose to include this new DLL in the next version of TB.

    *Brian

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    No, no meaning at the moment.
    Just generic error in case of not zero.

    Yes, sure: your name will be added as "Thanks To" in the bug fix.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. Lua Sets
    By danbaron in forum Scripting
    Replies: 0
    Last Post: 12-11-2010, 07:10
  2. Perl Sets
    By danbaron in forum Scripting
    Replies: 1
    Last Post: 26-10-2010, 02:04
  3. Python Sets
    By danbaron in forum Scripting
    Replies: 5
    Last Post: 24-10-2010, 06:10
  4. Ruby Sets
    By danbaron in forum Scripting
    Replies: 0
    Last Post: 15-10-2010, 20:44
  5. Infinite Sets
    By danbaron in forum Math: all about
    Replies: 7
    Last Post: 28-01-2010, 10:01

Members who have read this thread: 5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •