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

xbasic code help

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

    #61
    Re: xbasic code help

    Close, but according to Windows convention for long paths, the exe and the argument should both be quoted, so you need one more.
    Code:
    sys_shell(\""C:\Program Files\HollywoodPM\Drops\4x6.exe[COLOR="Red"]\"[/COLOR] \"C:\Program Files\HollywoodPM\Drops\Trigger.jpg\"",1)
    In some cases you don't need the quotes around each element, but adding them even when not needed is not a detriment.

    Getting the quotes correct is always a challenge and using a quoted character string is easier. Another potential solution for long path names is to convert the path with file.longname_to_shortname() to convert a long name to a short name.

    In this case, we still don't know if 4X6.exe even accepts an argument on startup. Many programs do not. If you can build a Windows shortcut that works, then the method described will work. But if it won't work in a shortcut, it won't work in sys_shell(). Until it is verified that a shortcut works, trying to force it to work in sys_shell() is an exercise in futility.

    Another option is to build an old DOS bat file and then run that with sys_shell("filename.bat",2). A batch file may give more options and can be created before the sys_shell() and then deleted after it runs. A bit of a kludge, but a solution sometimes required for unusual problems.
    Originally posted by Marcel Kollenaar View Post
    Thus, this should have worked?

    sys_shell(\""C:\Program Files\HollywoodPM\Drops\4x6.exe \"C:\Program Files\HollywoodPM\Drops\Trigger.jpg\"",1)

    4x6 is only 64 kb. Must be a simple tool. Maybe write a new and better one in Purebasic! :D

    Comment


      #62
      Re: xbasic code help

      Originally posted by JerryBrightbill View Post
      Close, but according to Windows convention for long paths, the exe and the argument should both be quoted, so you need one more.
      Code:
      sys_shell(\""C:\Program Files\HollywoodPM\Drops\4x6.exe[COLOR=red]\"[/COLOR] \"C:\Program Files\HollywoodPM\Drops\Trigger.jpg\"",1)
      In some cases you don't need the quotes around each element, but adding them even when not needed is not a detriment.

      Getting the quotes correct is always a challenge and using a quoted character string is easier. Another potential solution for long path names is to convert the path with file.longname_to_shortname() to convert a long name to a short name.

      In this case, we still don't know if 4X6.exe even accepts an argument on startup. Many programs do not. If you can build a Windows shortcut that works, then the method described will work. But if it won't work in a shortcut, it won't work in sys_shell(). Until it is verified that a shortcut works, trying to force it to work in sys_shell() is an exercise in futility.

      Another option is to build an old DOS bat file and then run that with sys_shell("filename.bat",2). A batch file may give more options and can be created before the sys_shell() and then deleted after it runs. A bit of a kludge, but a solution sometimes required for unusual problems.
      We did get it to accept command line (in DOS) arguments, and Ed said he normally drops .jpg files onto his 4x6.exe shortcut to launch it.


      Originally Posted by Jeff@Listbrokers
      ok... the last thing I would try, that should, definitively show (to me) whether 4x6.exe's argument parsing is poorly written. Try doing the same thing that you just did in DOS but use the path without spaces... if it works correctly, to me, that indicates that the app is just poorly coded. If not, then, I'll have to scratch my head somemore in confusion.


      Originally posted by Ed

      This works.

      I used

      cd \HollywoodPM\Drops\

      then
      4x6.exe c:\HollywoodPM\Drops\trigger.jpg

      and it opens Photo Shop and creates a 4x6 blank image area very fast doing it this way.

      No word space
      Last edited by Jeff@Listbrokers; 01-25-2007, 11:30 AM.

      Comment


        #63
        Re: xbasic code help

        This horse has been beaten to death and I don't wish to inflict any more atrocity on it but I still can't quite understand why did alpha chose in this particular function to use a space as a parameter separator as opposed to the conventional comma and how does alpha determine when it comes across the first space that it is part of the file name and not the separator?

        This is how the help file illustrate how to use this function:
        x = sys_shell("c:\windows\notepad.exe c:\windows\a5.ini",1)
        Instead of relentless attempts to explain away a bad, albeit a small error, just fix it and move on.

        Comment


          #64
          Re: xbasic code help

          Ed,

          Came up with a solution for your droplets. Good ol' Alpha has already created the way to fix this using the file.longname_to_shortname() method. Since the droplet programs that Photoshop creates are not able to deal with spaces how about we try this:

          dim droplet as c
          dim photo as c

          droplet=file.longname_to_shortname("C:\Program Files\HollywoodPM\Drops\4x6.exe")
          photo=file.longname_to_shortname("C:\Program Files\HollywoodPM\Drops\Trigger.jpg")

          sys_shell(droplet+" "+photo)

          Hope this finally solves your problem!
          Doug

          Comment


            #65
            Re: xbasic code help

            Doug

            Bingo Bigno it's a winner.

            This works

            droplet=file.longname_to_shortname("C:\Program Files\HollywoodPM\Drops\4x6.exe")
            photo=file.longname_to_shortname("C:\Program Files\HollywoodPM\Drops\Trigger.jpg")

            sys_shell(droplet+" "+photo)


            I did not use the

            dim droplet as c
            dim photo as c do i need to ?

            Thank you very much.
            It looks like i can get to work on it now that i know what folder i can place the droplets in.

            Comment


              #66
              Re: xbasic code help

              Originally posted by Doug Page View Post
              ....Good ol' Alpha has already created the way to fix this using the file.longname_to_shortname() method.....
              Hope this finally solves your problem!
              Doug
              Thanks Doug! Mine too! :)
              Marcel

              I hear and I forget. I see and I remember. I do and I understand.
              ---- Confusius ----

              Comment


                #67
                Re: xbasic code help

                Ed,

                From the HELP file:

                Declaring a Variable

                Before a variable is used either by a script or in an expression, it must be declared. A variable can be declared either explicitly (as a formal declaration in a script, a table, a set, a form, or an application) or implicitly (by assigning it a value for the first time in a script). In general, a variable declaration must specify two things: the name of the variable, and the type of data the variable will contain.
                Most likely you must have already declared the variables mentioned previously for the script to work as intended.


                Mike
                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


                  #68
                  Re: xbasic code help

                  Gabe, you need to take a step back and re-examine the command and how it is used. Alpha didn't make a choice here to use a space as a parameter seprator. sys_shell executes a command line and the first parameter to that function is the command line to run.

                  The Windows command interpreter uses spaces to delimit command parameters from the command itself. If your specific command line needs spaces in it, that is a function of the operating system and nothing Alpha or any other software other than the operating system has any control over.

                  Originally posted by G Gabriel View Post
                  This horse has been beaten to death and I don't wish to inflict any more atrocity on it but I still can't quite understand why did alpha chose in this particular function to use a space as a parameter separator as opposed to the conventional comma and how does alpha determine when it comes across the first space that it is part of the file name and not the separator?

                  This is how the help file illustrate how to use this function:


                  Instead of relentless attempts to explain away a bad, albeit a small error, just fix it and move on.

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

                  Comment


                    #69
                    Re: xbasic code help

                    Lenny:
                    Here is what the help file says:
                    SYS_SHELL( Program_Name [ argument1 ... argumentN ] as C [, Window_Mode as N ] )
                    and for an example:
                    x = sys_shell("c:\windows\notepad.exe c:\windows\a5.ini",1)
                    My question is: how would alpha know when it comes across the first space if it is part of the name or a separator between the arguments?

                    The Windows command interpreter uses spaces to delimit command parameters from the command itself. If your specific command line needs spaces in it, that is a function of the operating system and nothing Alpha or any other software other than the operating system has any control over.
                    Then sys_shell() should not be a high level function as the example in this thread shows that it won't work as written. Only time it worked is when preceded by other commands to shorten the name, or as I suggested early on and somehow got missed in this lenthy thread to use variables to replace the long names.
                    Last edited by G Gabriel; 01-29-2007, 01:18 PM.

                    Comment

                    Working...
                    X