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

Is SYS_SHELL() a "UI method?"

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

    Is SYS_SHELL() a "UI method?"

    I've gotten a bastinado by (naively) recommending a UI method be used on a web page. So, I'm not too thrilled to ask this, but is SYS_SHELL() one of the so-called "UI methods?" Is there a list of what functions can be used and in what context(s)?

    Judging from the Help file, some "UI functions" are named with an initial "UI_", yet I've been told that some functions have this characteristic, yet are not named with "UI_". Is there a reason for this?

    [BTW, I'm using SYS_SHELL() on an A5WCMP that's embedded in a web page and it's coming up with the fearsome and awful "Stack Underflow" error.]
    Last edited by pruel; 01-19-2006, 10:00 PM.

    #2
    Phil, I can't imagine sys_shell() would work since it would allow you (presumably) to access the desktop directly thus circumventing built-in browser security. If it does work, I would be very interested.
    Peter
    AlphaBase Solutions, LLC

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


    Comment


      #3
      Phil, I try to use my stick sparingly so I hope you don't feel as though I'm the one that beat you. I did however want to make sure folks, including you, were aware of the reason hourglass_cursor() does not work in a web application. Many developers, particulary those newer to web applications, are still not fully comfortable with the distinction between client and server and what gets executed where. This is a very important concept so it is worth repeating for everyone's benefit.

      sys_shell() can be used in a web application. Does the sys_shell command, as you've constructed it, work in the Interactive wWindow? What about in a basic A5W page? If yes to both of those, what is the command as you are running it?

      There is no list of ui-related fuctions that cannot be used. But as a general rule, if it raises a dialog box or manipulates Alpha's or Windows' user interface in any way, it cannot be used in the Web App Server.

      Originally posted by pruel
      I've gotten a bastinado by (naively) recommending a UI method be used on a web page. So, I'm not too thrilled to ask this, but is SYS_SHELL() one of the so-called "UI methods?" Is there a list of what functions can be used and in what context(s)?

      Judging from the Help file, some "UI functions" are named with an initial "UI_", yet I've been told that some functions have this characteristic, yet are not named with "UI_". Is there a reason for this?

      [BTW, I'm using SYS_SHELL() on an A5WCMP that's embedded in a web page and it's coming up with the fearsome and awful "Stack Underflow" error.]

      Lenny Forziati
      Vice President, Internet Products and Technical Services
      Alpha Software Corporation

      Comment


        #4
        Peter, remember that all Xbasic code in A5W pages an components runs on the server. sys_shell() would be accessing the server's desktop, not the client's, so there is no browser (client) security to circumvent.

        Originally posted by Peter G.
        Phil, I can't imagine sys_shell() would work since it would allow you (presumably) to access the desktop directly thus circumventing built-in browser security. If it does work, I would be very interested.

        Lenny Forziati
        Vice President, Internet Products and Technical Services
        Alpha Software Corporation

        Comment


          #5
          Originally posted by Lenny Forziati
          Peter, remember that all Xbasic code in A5W pages an components runs on the server. sys_shell() would be accessing the server's desktop, not the client's, so there is no browser (client) security to circumvent.
          Aaahhh...I see. That is very interesting.
          Peter
          AlphaBase Solutions, LLC

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


          Comment


            #6
            Yeah, I'm SYS_SHELL()-ing out to a bash script that gets a database preimage (a la the format one gets with a PROPERTY_TO_STRING(Args) in the AfterUpdateRecords event) so that I can log the database pre- and post- images when a user makes a table update.

            Obviously painful, but without A5 support for the "before and after" information, I can't figure out how else to do it. I suppose I could rely on the database's journalling, but that is database specific and I didn't want that.

            Lenny: the call looks "like" this:

            SYS_SHELL("<path>/mybashscript <args>", 2);

            Where <path> and <args> are replaced with goobledegook.

            Comment


              #7
              What about...
              Originally posted by Lenny Forziati
              Does the sys_shell command, as you've constructed it, work in the Interactive Window? What about in a basic A5W page?

              Lenny Forziati
              Vice President, Internet Products and Technical Services
              Alpha Software Corporation

              Comment


                #8
                Originally posted by Lenny Forziati
                What about...
                It works in the interactive window. I can't set up a "basic a5w page" at the moment.

                Comment


                  #9
                  How are you running a bash script with unix-style slashes ('/') and naming conventions from a Windows server?
                  Aaron Brown
                  Alpha Software Development Team

                  Comment


                    #10
                    Well, I've got cygwin (get it yourself!) installed, but that only answers the bash question. However, your SYS_SHELL() seems to have no problem finding c:/cygwin/bin/bash" and then passing it the rest of the stuff. Maybe SYS_SHELL() does / <--> \ mapping magic on arg[0]?

                    It works, though ;)

                    Providing more detail that I wanted to initially, here is what the command really looks like:

                    ? sys_shell("c:/cygwin/bin/bash.exe c:/temp/A5CCRQuery 57 xyzzy c:/temp/fooo",1)
                    = 33


                    I changed the second argument to 1 and added a sleep 10; to the script so I could watch the window and make sure it didn't choke or write to standard out.
                    Last edited by pruel; 01-27-2006, 06:21 PM.

                    Comment


                      #11
                      Originally posted by pruel
                      Well, I've got cygwin (get it yourself!) installed, but that only answers the bash question. However, your SYS_SHELL() seems to have no problem finding c:/cygwin/bin/bash" and then passing it the rest of the stuff. Maybe SYS_SHELL() does / <--> \ mapping magic on arg[0]?

                      It works, though ;)
                      Yes, I've used cygwin myself quite a bit. I am just surprised that the slash mapping worked and that it knew to run your script with bash without specifically specifying it in the sys_shell(). I would expect that you would need to do the following for it to work:

                      sys_shell("c:\cygwin\bin\bash <path>/mybashscript <args>", 2)

                      However, after researching the function a bit more, I am concerned that sys_shell() would even work from an a5w page since it, by nature, runs things in a window, even if you have the window mode set to minimize.

                      Have you tried sys_open()?
                      Aaron Brown
                      Alpha Software Development Team

                      Comment


                        #12
                        Originally posted by AaronBBrown
                        Yes, I've used cygwin myself quite a bit. I am just surprised that the slash mapping worked and that it knew to run your script with bash without specifically specifying it in the sys_shell(). I would expect that you would need to do the following for it to work:

                        sys_shell("c:\cygwin\bin\bash <path>/mybashscript <args>", 2)

                        However, after researching the function a bit more, I am concerned that sys_shell() would even work from an a5w page since it, by nature, runs things in a window, even if you have the window mode set to minimize.

                        Have you tried sys_open()?
                        I'd assumed you knew about Cygwin, but I put the URL up in case others read the post.

                        The SYS_SHELL() invocation I previously posted did have the cygdrive path to bash as the first argument, so the only slash-mapping mystery would be in arg[0]. I misled you a bit with the earlier posting where I elided the reference to the command interpreter (bash) as arg[0]. Sorry bout dat.

                        I haven't tried SYS_OPEN(), but I naturally try to avoid file extension hacks since I also use an interactive bash and hate to have to type foo.bsh if you know what I mean ;)

                        Do you think it might work better? Or perhaps just differently? Can I also use args in the string passed to SYS_OPEN()?

                        Thanks, Aaron.

                        PS: Could you take a look at my other posting (http://msgboard.alphasoftware.com/al...hlight=pruel)? I'd like to get an answer to this and it looks like Lenny thinks he can have a life!! LOL
                        Last edited by pruel; 01-27-2006, 06:40 PM.

                        Comment


                          #13
                          Originally posted by pruel
                          I haven't tried SYS_OPEN(), but I naturally try to avoid file extension hacks since I also use an interactive bash and hate to have to type foo.bsh if you know what I mean ;)
                          I understand, but since it looks like sys_shell() isn't doing the job, it might be at least worth a shot. Instead of registering .bsh as a file type, you could create a .bat file that calls the bash code and call the .bat file from sys_open(). This would at least test whether what you are doing is feasible.
                          Aaron Brown
                          Alpha Software Development Team

                          Comment


                            #14
                            You may get sys_shell() to work, but you're probably better off with sys_shell_wait(). When sys_shell() fires, your Xbasic keeps running, and it is likely that you want to pause until the bash script actually finishes, particulary if you're placing the call to sys_shell() in a grid component's events and you want to capture views of the data before and after the updates occur.

                            Comment


                              #15
                              Originally posted by Peter.Wayne
                              You may get sys_shell() to work, but you're probably better off with sys_shell_wait(). When sys_shell() fires, your Xbasic keeps running, and it is likely that you want to pause until the bash script actually finishes, particulary if you're placing the call to sys_shell() in a grid component's events and you want to capture views of the data before and after the updates occur.
                              Whoa! That might explain the intermittent incorrect results of the script!

                              This should be better documented. The SYS_SHELL() help file doesn't say anything about the fact that it's executing the command asynchronously!! Furthermore, in the help file page for SYS_SHELL(), there is no reference to SYS_SHELL_WAIT().

                              A5 guys: could you fix the documentation? Thanks.

                              Comment

                              Working...
                              X