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

Sys_shell Command

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

    Sys_shell Command

    I'm not sure what is happening here but when i try to run a shell command from alpha i get argument is invalid data type
    Code:
    'Get 'Value' property of 'Field1' in Form 'diallist' .
    DIM SHARED dial AS c
    dial = parentform:Field1.value
    
    'Execute inline Xbasic code.
    sys_shell(x-lite.exe -dial=sip:9+Var->dial)
    trying to make a click to dial setup
    Last edited by steve745; 11-16-2009, 09:40 PM. Reason: Overlooked
    https://www.housingeducator.org
    k3srg

    #2
    Re: Sys_shell Command

    Note the first parameter is specified as

    Program_Name [ argument1 ... argumentN ] as C

    When you see as C think quoted character string.

    Try

    sys_shell("x-lite.exe -dial=sip:9"+quote(var->dial))

    or similar.
    There can be only one.

    Comment


      #3
      Re: Sys_shell Command

      hmm m this is what i get
      Script:OnFetch line:13
      sys_shell("c:\x-lite -dial=sip:9"+quote(var->dial))
      Out of memory
      path was set in windows
      https://www.housingeducator.org
      k3srg

      Comment


        #4
        Re: Sys_shell Command

        or if i can get something like open url sip:9 var->dial
        i tried to use the open url but had no luck any other ways anyone canthink of
        https://www.housingeducator.org
        k3srg

        Comment


          #5
          Re: Sys_shell Command

          I find the syntax confusing. Why are you using the same name for the function to dial as well as the name for the number to dial? Suggest you grab the text (not the value) from Field1, and then store it in a variable with a different name than dial.

          Comment


            #6
            Re: Sys_shell Command

            Made the change you suggested tom but i still get \
            Script:OnFetch line:13
            sys_shell(xlite -dial=sip:9+var->sipcall)
            Argument is incorrect data type
            I tried to tinker with conver_type() last night but was getting no where... Do you think it could work here and how could i fire it.
            https://www.housingeducator.org
            k3srg

            Comment


              #7
              Re: Sys_shell Command

              Have no clue how xlite works. It's likely the problem is how you are framing the arguments.

              for example sys_shell() is expecting a character string and you've left off the quotes.

              what might xlite be expecting?

              a useful technique for unscrambling this is to figure out how to do it without using variables. i.e. use literal strings. then substitute in the variable for the literal string

              Comment


                #8
                Re: Sys_shell Command

                Stan (all),
                Probably not a solution but I am curious as to why the use of quote(var->dial) instead of s_quote(var->dial) which I have taken as the function to use for variables?---and have found instances of just using "quote()" not working with variables.
                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


                  #9
                  Re: Sys_shell Command

                  ok it works like this

                  Code:
                  'Get 'Text' property of 'Phone' in Form 'diallist' .
                  DIM SHARED sipcall AS c
                  sipcall = parentform:Phone.text
                  
                  'Open program: C:\Program Files\CounterPath\X-Lite\x-lite.exe
                  if file.exists("C:\Program Files\CounterPath\X-Lite\x-lite.exe") then 
                  	sys_shell("C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212",1)
                  else
                  	ui_msg_box("Error Opening Program","File 'C:\Program Files\CounterPath\X-Lite\x-lite.exe' does not exist.",ui_stop_symbol)
                  end if
                  That is straight phone # i just can't figure out how to put the var.. after dial= i need 9 there first to get the outside line
                  https://www.housingeducator.org
                  k3srg

                  Comment


                    #10
                    Re: Sys_shell Command

                    s_quote() worked
                    https://www.housingeducator.org
                    k3srg

                    Comment


                      #11
                      Re: Sys_shell Command

                      Originally posted by MikeC View Post
                      Stan (all),
                      Probably not a solution but I am curious as to why the use of quote(var->dial) instead of s_quote(var->dial) which I have taken as the function to use for variables?---and have found instances of just using "quote()" not working with variables.
                      S_quote() is always proper. S_quote is useful when constructing filters with date variables especially.

                      Since the initial post indicated

                      DIM SHARED dial AS c

                      then quote() should be sufficient.

                      Code:
                      tst = "abc"
                      
                      
                      ? "somefilterhere = "+quote(var->tst)
                      = somefilterhere = "abc"
                      
                      ? "somefilterhere = "+s_quote(var->tst)
                      = somefilterhere = "abc"
                      There can be only one.

                      Comment


                        #12
                        Re: Sys_shell Command

                        Steven, how about showing us the final expression?

                        Thanks.

                        -- tom

                        Comment


                          #13
                          Re: Sys_shell Command

                          Stan,
                          then quote() should be sufficient
                          As it did not work in Steve's case could you explain why? There must be some subtlety I do not know about that allows quote() to work most times with a variable but not all the time....almost a moot point really as I tend to use s_quote always when dealing with a variable but always nice to gain a few more bits of information.
                          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


                            #14
                            Re: Sys_shell Command

                            Mike,

                            I'm not sure whether we were/are working with a character string.

                            Since this worked
                            sys_shell("C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212",1)
                            it seems that the "dial" variable doesn't need to be quoted in the first parameter.


                            Code:
                            dial ="5551212" 'AS CHARACTER
                            
                            ? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212"
                            = "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212"
                            
                            ? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="+"5551212"
                            = "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212"
                            
                            ? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="+var->dial
                            = "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212"
                            
                            [COLOR="Red"]? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="+quote(var->dial)
                            = C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="5551212"
                            
                            ? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="+s_quote(var->dial)
                            = C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="5551212"
                            
                            equivalent and incorrect[/COLOR]

                            Code:
                            dial = 5551212 'AS NUMERIC
                            
                            ? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="+var->dial
                            = "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212"
                            [COLOR="Blue"]'Alpha automatic data conversion when concatenating[/COLOR]
                            
                            
                            [COLOR="red"]? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="+quote(var->dial)
                            ERROR: Argument is incorrect data type[/COLOR]
                            'quote() is improper due to data type
                            
                            ? "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial="+s_quote(var->dial)
                            = "C:\Program Files\CounterPath\X-Lite\x-lite.exe -dial=5551212"
                            's_quote() handles multiple data types
                            Last edited by Stan Mathews; 11-17-2009, 05:06 PM.
                            There can be only one.

                            Comment


                              #15
                              Re: Sys_shell Command

                              Thanks for the explanation Stan....always nice to put a little more understanding into my head!! :) I'll get there eventually (or at least plan to!).
                              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

                              Working...
                              X