Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

hostavailable - always .T.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    hostavailable - always .T.

    Huh???
    Code:
    ?hostavailable("asdfqwww.xxqwerspxx.jnk")
    .T.
    Can someone else please confirm that the hostavailable() command always returns .T. even when the website definition is nonsense.

    #2
    Re: hostavailable - always .T.

    Not sure if it will help but the question was recently discussed here.

    And your expression gets a false here.

    Code:
    ?hostavailable("asdfqwww.xxqwerspxx.jnk")
    = .F.
    There can be only one.

    Comment


      #3
      Re: hostavailable - always .T.

      Cal:

      Code:
      ?hostavailable("asdfqwww.xxqwerspxx.jnk")
      = .F.
      EDIT: I'm using v.8
      Last edited by Peter.Greulich; 02-16-2009, 10:54 AM.
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        Re: hostavailable - always .T.

        Originally posted by Stan Mathews View Post
        Not sure if it will help but the question was recently discussed here.

        And your expression gets a false here.

        Code:
        ?hostavailable("asdfqwww.xxqwerspxx.jnk")
        = .F.
        That's not the same issue. If it was a valid host, then I could understand testing for a specific port. Somehow I don't think "asdfqwww.xxqwerspxx.jnk" is a valid host name. It certainly doesn't come up in my browser!:p

        Originally posted by Peter.Greulich View Post
        Code:
        ?hostavailable("asdfqwww.xxqwerspxx.jnk")
        = .F.
        EDIT: I'm using v.8
        Ruh, roh. Something's strange. It returns .T. for me in both v8 and v9. I know it used to work in v8 so what's going on?

        Comment


          #5
          Re: hostavailable - always .T.

          Cal, did you try a reboot?
          Peter
          AlphaBase Solutions, LLC

          [email protected]
          https://www.alphabasesolutions.com


          Comment


            #6
            Re: hostavailable - always .T.

            Originally posted by Peter.Greulich View Post
            Cal, did you try a reboot?
            Yep!

            There's definitely something weird going on. My customers are getting occasional error messages because their computers are returning .F. to this command. I use it to check for an internet connection before starting certain uploads/downloads. In their case, it sometimes returns .F. even when there is an internet connection and my host site is up and running.

            At least I know it's something on my end now.

            Comment


              #7
              Re: hostavailable - always .T.

              Cal,

              Something's gone awry with this function. You'll recall that I posted 10 days ago or so that on a couple PCs it was always returning false when it had been working correctly (or so I thought).

              http://msgboard.alphasoftware.com/al...hostavailable()

              On those 2 PCs all I still get is false with google, yahoo, microsoft, etc.

              I have 2 A5V8 developer edition PCs, latest patch, plugged into the same network switch. One returns correctly, then other one is always false. The one that always returns F also has V9 loaded on it and it also always returns False.

              I thought it might be a Microsoft or Java update as the cause, but really didn't have a clue as to why it suddenly stopped working.

              I have not submitted a bug report at this time because it's not reproducible on all PCs. I think someone from Alpha is going to have to look under the hood of this function and see what's up.

              ba

              Comment


                #8
                Re: hostavailable - always .T.

                Hi Cal,

                I get false as well when trying your code.

                The hostavailable() has not changed from version 8 code, so it's either something at your end, or the underlying code associated with sockets.open() .or. sockets.query_tcp() has changed in some odd way.

                I always try it with "www.google.com" and go from that point.
                Regards,

                Ira J. Perlow
                Computer Systems Design


                CSDA A5 Products
                New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                CSDA Barcode Functions

                CSDA Code Utility
                CSDA Screen Capture


                Comment


                  #9
                  Re: hostavailable - always .T.

                  Cal

                  I've resurrected an old app on v6 and found I've got an alternative to the hostavailable() function - perhaps it will work for you if you haven't already sorted the problem yourself. I created this because the client that was using the app was on a Microsoft SBS2000 network with the Microsoft Firewall Client, and the Hostavailable() function always returned .F. no matter what address was used or port no selected.

                  The function name is InternetConnectionStatus([WebAddress AS C])

                  Function works in v6 and above

                  Chris
                  If It Works First Time, There's Something Wrong!!!

                  Comment


                    #10
                    Re: hostavailable - always .T.

                    Cal:
                    Excuse me, but asdfqwww.xxqwerspxx.jnk happens to be my website!
                    Just go to your browser, type asdfqwww.xxqwerspxx.jnk and see what happens.

                    My Web Site

                    Code:
                    ?hostavailable("asdfqwww.xxqwerspxx.jnk")
                    = .T.
                    ?hostavailable("abc")
                    = .F.
                    
                    ?hostavailable("abc.com")
                    = .T.
                    
                    ?hostavailable("abc.jnk")
                    = .T.
                    I would think this is a bug or a misnomer:
                    alpha checks to see if the server is available by checking the port. Fair enough. But it seems that most browsers will take you to the closest match to your URL or to their default "server not available" page (search page) that basically redirects either to google or some spam. I think alpha should check the port AS WELL AS the URL.

                    Let me add to the confusion:
                    The HOSTAVAILABLE() function returns .T. (TRUE) if an internet connection is available. It checks to see if http://www.google.com responds.
                    Last edited by G Gabriel; 04-08-2009, 06:32 PM.

                    Comment


                      #11
                      Re: hostavailable - always .T.

                      Perhaps you need something like this instead:
                      Code:
                      dim request as P
                      dim response as P
                      request.host = "asdfqwww.xxqwerspxx.jnk"
                      request.page = "asdfqwww.xxqwerspxx.jnk/userguide.pdf"
                      request.method = "HEAD"
                      response = http_fetch(request)
                      ? response.parsed_headers.status_code
                      = 404
                      ' where 404 means site not available

                      Comment


                        #12
                        Re: hostavailable - always .T.

                        Originally posted by G Gabriel View Post
                        Let me add to the confusion:
                        The HOSTAVAILABLE() function returns .T. (TRUE) if an internet connection is available. It checks to see if http://www.google.com responds.
                        Yes. That is what the Help file says but my guess is that it's not quite true. I think someone left out the word "default" somewhere.

                        If it always checks for Google, then why bother allowing arguments? The syntax says:
                        HOSTAVAILABLE( [ Host as C [, Port as N ]] )

                        Comment


                          #13
                          Re: hostavailable - always .T.

                          Thanks Chris. Does your routine just tell me that my own internet connection is OK? It seems to return .T. all the time.

                          G's method using "request" seems to do what I want.

                          The only issue with the "request" method is figuring out which response codes are acceptable. So far both 200 and 302 seem to OK. Looking at the list I found on the internet, it looks like anything under 300 should be OK - although most are not likely.

                          If I use that, I'll probably build a function that includes a "failure message" and maybe even allow an option to continue anyway.

                          FWIW:

                          I got a 302 response on my own website that is using A5WAS and 200 on my other site that just uses standard web pages and is on a different server. I have no idea whether that is due to the WAS or the server setup but I suspect it's the server setup.

                          I also got a 301 response (moved permanently?) to www.googlex.com when it sent me to some other site that offered me some related options. However, www.googlexzq.com returned a 404.

                          Comment


                            #14
                            Re: hostavailable - always .T.

                            Hi all,
                            I just tried this again and it works....but not like I expected. It will show correctly true or false but ONLY for if a site exists such as serftp.com, google.com, tttt.com --all of which produce a true result.

                            Now try gghhii.com, pennifig.com, or calocklin.com and they all come up as false.

                            So it apparently does not test for anything but what comes before and after the last dot.

                            Am interested if anyone finds what I found to be true.....


                            Oh Yeah--you do have to run the function each time prior to testing in the interactive window.
                            Mike
                            __________________________________________
                            It is only when we forget all our learning that we begin to know.
                            It's not what you look at that matters, it's what you see.
                            Henry David Thoreau
                            __________________________________________



                            Comment


                              #15
                              Re: hostavailable - always .T.

                              Hi Cal

                              Can you try www.crapaholictest.com with the function I supplied (not an IP address), and if the function returns "Success" then you have a firewall problem. You should get the response 'Destination Protocol Unreachable'. Some firewalls, even when turned off will still default to IP address 127.0.0.1 and will still produce a successful result. Sometimes the opposite is true; this is why Hostavailable() didn't work for my client at the time.

                              The function I supplied is based on the ping status.
                              If It Works First Time, There's Something Wrong!!!

                              Comment

                              Working...
                              X