Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

AMS 4 Documentation, lack of examples

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

  • AMS 4 Documentation, lack of examples

    Hi,

    I have just upgraded from version 3 to 4 and the new version has so much good stuff in it. The problem is I know the product can do what I want to do but I can't work out how.

    There are few if any examples in the user guide/help file and not much stuff in the templates.

    For example, becuase I use Visual Basic constantly I want to do lots of stuff in the macro language but I can't find a simple reference in the documenation on how to get at objects.

    I want to read some text files then populate some list boxes that are in my project. Can I get at %SrcDrv% so I know were to look for my files ? Once I parse my text files can I refence the list boxes in my project to add items to them ?






  • #2
    Re: AMS 4 Documentation, lack of examples

    Don't worry, we're still working on the documentation. In fact, a whole bunch of action examples should be going into the help file in the next few weeks.

    As for the macro language, do you mean the built-in VBA macro support for the design environment? If so, there is a COM reference document in the AutoPlay Media Studio\Docs folder:

    C:\Program Files\AutoPlay Media Studio 4.0\Docs\COM Automation Reference.doc

    Or do you mean the actions that you can use on the Actions tabs, like "File - Execute" and such? (Like I mentioned above, we're still working to get more examples of action scripts into the help file.)

    Sorry if I seem a bit confused; we don't call the action stuff "macros," and there is support for VBA macros in the design environment, but it's something else. [img]/ubbthreads/images/icons/laugh.gif[/img]
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      Re: AMS 4 Documentation, lack of examples

      Hi Lorne,

      Thanks for the reply, I meant using SaxBasic.
      And just a little rant, like all great products it ain't a lot of use if you can't work out how to use the thing. I have seen very few companies that spent enough time on the help, examples and guides, they always seem to be just an after thought that gets minimal resources in the development life cycle.

      And I do worry becuase I thought I purchased a completed product, this is not the Beta we are talking about :-(

      Comment


      • #4
        Re: AMS 4 Documentation, lack of examples

        I understand how you feel. The COM automation documentation could definitely use some work; I don't know when it's going to be updated, though. The sad fact is that the COM automation is a bit of a "fringe" feature in AMS 4.0...it's mainly there for people who would already know how to use it, hence the relatively slim documentation.

        That said, if you have any questions, feel free to post them.
        --[[ Indigo Rose Software Developer ]]

        Comment


        • #5
          Re: AMS 4 Documentation, lack of examples


          That said, if you have any questions, feel free to post them
          ... um .. as posted already Lorne, how do yu use SAX? [img]/ubbthreads/images/icons/smile.gif[/img]

          I guess the question, really, is .. if i write code in SAX, how do i then tell 'an object'

          "Right, now go use that bit of code"

          A short example will work
          -
          = Derek
          ["All glory comes from daring to begin" - fortune cookie]

          Comment


          • #6
            Re: AMS 4 Documentation, lack of examples

            Tenor or alto?

            Comment


            • #7
              Re: AMS 4 Documentation, lack of examples

              lol ... I think i prefer Tenor .. easier to listen to
              -
              = Derek
              ["All glory comes from daring to begin" - fortune cookie]

              Comment


              • #8
                Re: AMS 4 Documentation, lack of examples

                I believe then the Dexter Gordon module will do what you're looking for. [img]/ubbthreads/images/icons/smile.gif[/img]

                Comment


                • #9
                  Re: AMS 4 Documentation, lack of examples

                  I thought I did ask a question. But now I will ask some more and provide some background.

                  Are you saying that SaxBasic only works for the development environment ?

                  What I am trying to do:-
                  The cd will have a bunch of files on it each month that consists of text files that have specifically formatted information (I have no control over the format) and a corresponding set of mpeg files. I want to write the autoplay program once so that it can be included each month on the CD without change.

                  The program needs to read all the text files on the disk then display some information from them in a list box (listbox1), there will be a different number each month and they will have different names (but the extension is always the same).

                  When the user clicks on an entry in listbox1 it needs to open the corresponding file and get more information from that file and display it in another list box (listbox2).

                  When the user clicks on a button the mpeg corresponding to an item in listbox1 will be displayed. If the user selects a different item in listbox1 then the cycle is repeated.

                  We currently have a Visual Basic program that does this but it needs runtimes and stuff. If we do it with autoplay we know it will "just work" directly from the CD. The assumption is that we can take our VB Code and paste it into SAX Basic and with a some alterations we could get the new app working.

                  Was this a bad assumption ?
                  I don't mind rebuilding the whole thing in autoplay but the doco sucks. I know I can do this but some working examples would be so so helpful.

                  Comment


                  • #10
                    Re: AMS 4 Documentation, lack of examples


                    Are you saying that SaxBasic only works for the development environment ?
                    Yes. Including SaxBasic support at run time would increase the size of the executable and I believe it would make it impossible for the executable to run without an install (there are TONS of Registry changes needed to register the GUIDs for all the components).


                    What I am trying to do:-
                    The cd will have a bunch of files on it each month that consists of text files that have specifically formatted information (I have no control over the format) and a corresponding set of mpeg files. I want to write the autoplay program once so that it can be included each month on the CD without change.

                    The program needs to read all the text files on the disk then display some information from them in a list box (listbox1), there will be a different number each month and they will have different names (but the extension is always the same).

                    When the user clicks on an entry in listbox1 it needs to open the corresponding file and get more information from that file and display it in another list box (listbox2).

                    When the user clicks on a button the mpeg corresponding to an item in listbox1 will be displayed. If the user selects a different item in listbox1 then the cycle is repeated.

                    You're in luck! This should all be do-able with AutoPlay's actions. [img]/ubbthreads/images/icons/laugh.gif[/img]


                    We currently have a Visual Basic program that does this but it needs runtimes and stuff. If we do it with autoplay we know it will "just work" directly from the CD. The assumption is that we can take our VB Code and paste it into SAX Basic and with a some alterations we could get the new app working.

                    Was this a bad assumption ?

                    Nope, just an incorrect one. The COM automation only applies to the design environment.

                    Your VB code would probably work if you copied and pasted it (it might need a little tweaking, since SaxBasic isn't 100% compatible with VBA...there are some exotic features that aren't supported). But this would only be at design time...it would have no effect on the autorun.exe at all.


                    I don't mind rebuilding the whole thing in autoplay but the doco sucks. I know I can do this but some working examples would be so so helpful.

                    Well, the actions to do this would be pretty straightforward. If you're familiar with VB code, you should find AutoPlay to be a piece of cake. It's much, much simpler.

                    Have you read chapters 8-10 in the User's Guide?

                    To do this project, you'll need a bunch of File Actions, String Actions, and Control Structures. You'll need a List Box Object and a Media Player Object. You could use an Image Object for the button...and use a Text Box Object to display the text from the second text file when the user selects an item.

                    How hard it is all depends on the format of those text files. Heck, if you describe the format (or paste a sample) I could probably whip up a quick example for you in a few minutes.
                    --[[ Indigo Rose Software Developer ]]

                    Comment


                    • #11
                      Re: AMS 4 Documentation, lack of examples

                      Yes I read the user guide, that's why I know this can be done. I just can't work out how. I have all the GUI stuff done I am just stuck on

                      1. How to populate the list box when the app starts i.e how to return the list of files that are on the CD.

                      2. How to parse each file and return information to the list boxes.

                      The part contents of a file is listed below. The Raceday Code is displayed in a label. The meeting location and date is displayed in listbox1 ie ALBURY 17/03/02

                      The horses for each race are displayed in listbox2 when you select a meeting from listbox1 and click a button(s) to show the race number. In the VB app there is an up and down button that rolls thru the available race numbers.

                      The file always has the racecode as the first line and always ends with a CR. There are obviously different numbers of races for each meeting and the race numbers are not always sequential.

                      Thanks for your interest and advise.


                      Raceday Code:ALR17032

                      ALBURY 17/03/02

                      RACE 1 1175
                      ==================
                      ARMAGUN
                      GEMAZZI
                      MISS AUDACITY
                      MY CHANTICLEER
                      REDSOCKS

                      RACE 2 1000
                      ==================
                      BONNIE PRINCE
                      DISRUPTED
                      FOR GRANTED
                      GREENHOUSE EXPRESS
                      MIGHTY AMBER
                      MY BIGSTONE
                      NOBLE CHEYENNE

                      RACE 3 1000
                      ==================
                      CHANOUR
                      EL VIXEN
                      ESCALADE
                      FINAL FORWARD
                      IMPOSING TOD
                      LADY FARMER
                      RAFFIN FAIR
                      RAIN GIFT
                      SUNDAY DRIVE
                      TALEANNI SPORTS
                      TARCOOLA STAR

                      Comment


                      • #12
                        Re: AMS 4 Documentation, lack of examples

                        Okay, this is pretty straightforward. To find out what files are on the CD, you need to use a "File - Search" action. Assuming these are all .txt files in a specific folder, it's a piece of cake. Just set *.txt as the filename you want to search for, disable the "Local fixed drives (hard drives)" option, select the "Specific folders/drives" option, and put %SrcDir%\foldername in the "Custom folders" path. (Replace "foldername" with the name of the folder that the text files are stored in on the CD.)

                        That will get you a variable called %Files% containing a double-semicolon delimited list list of all the text files in that folder.

                        There are a lot of different ways you can proceed from there. You could set up a WHILE loop to get each file path (using "String - Get Delimited String"), read the file's contents into a variable ("Text File - Read"), and then store all the different bits of information into a bunch of global lists; one for the filenames, one for the raceday codes, one that you would use to hold the list of horses for each race (clearing the list and rebuilding it each time a race was selected). You could use separate lists, or you could store lots of bits of information together in a Global List item by separating the information with some kind of delimiter (i.e. storing delimited lists in the Global List instead of single items).

                        Or, you could process the files "live" as the user selects the items. Or some combination of the two.

                        I'm not sure if you want to display the filenames in a list box, or just the raceday codes from the files. If you want to list the filenames, that's really easy to do by using a "List Box Object - Add Files" action, to add the delimited list of files in the %Files% variable to the list.

                        Then just add some actions to the On Selection Changed event for listbox1 to read in the text file ("Text File - Read") and search grab the first line ("Text File - Get Line"), grab the text after the "Raceday Code:" part ("String - Mid").

                        Then you need to grab the next line with text on it and store it as the race code in a variable. If the race code is ALWAYS on the third line in the text file, you can just use a simple "Text File - Get Line" action to grab it...otherwise, you'll need to do a short while loop to get the next line and test whether it's blank, stopping once you've found one that isn't devoid of text.

                        Then it's just a matter of parsing the file. This part is pretty simple, so I won't bother explaining how. (Just set up a loop, and get each line of text from the file, one at a time. Or grab the whole file, and then use some "String - Replace" actions to convert the lines into delimited lists.) I'd probably store everything as list box items, with the race number as the item text, and the list of horses as a delimited list in the item's data. Like so:

                        RACE 1 1175::ARMAGUN^GEMAZZI^MISS AUDACITY^MY CHANTICLEER^REDSOCKS;;RACE 2 1000::BONNIE PRINCE^DISRUPTED^FOR GRANTED^GREENHOUSE EXPRESS^MIGHTY AMBER^MY BIGSTONE^NOBLE CHEYENNE;;RACE 3 1000::CHANOUR^EL VIXEN^ESCALADE^
                        FINAL FORWARD^IMPOSING TOD^LADY FARMER^RAFFIN FAIR^RAIN GIFT^SUNDAY DRIVE^TALEANNI SPORTS^TARCOOLA STAR

                        ...etc. (I picked "^" as a delimiter, but you could use whatever you want, so long as it doesn't appear in the text.)

                        This way, the list box would look like this:

                        RACE 1 1175
                        RACE 2 1000
                        RACE 3 1000

                        ...and you could set the list box to be sorted at run time, so it wouldn't matter what order the information was in the text file.

                        When the user selects an item in that list box, you just use a "List Box Object - Get Selected" action to find out the index of the item they selected, and then use "List Box Object - Get Item Data" to get the item data (the part after the :: ) for the item they selected.

                        Then just pass that delimited list to your listbox2, and change the delimiter from ;; to ^ or whatever you used instead.
                        --[[ Indigo Rose Software Developer ]]

                        Comment


                        • #13
                          Re: AMS 4 Documentation, lack of examples

                          Ah, what the heck. [img]/ubbthreads/images/icons/laugh.gif[/img]

                          I had an idea for an easy way to parse the file (more like massaging it instead of actually parsing it), so I decided to put it together as a sample project.

                          The attached project should be of some help, I would think.

                          Edit: updated link to point to the "fixed" attachment.

                          10370-Raceday.zip
                          --[[ Indigo Rose Software Developer ]]

                          Comment


                          • #14
                            Re: AMS 4 Documentation, lack of examples

                            Lorne - yu obv tested this there but it's not working for me. It seems to be having a problem starting from:

                            replace #ASC_CR##ASC_LF#==================#ASC_CR##ASC_LF#

                            with ::

                            coz i'm getting:

                            Race 1 1175||==========

                            showing in the races LBO
                            -
                            = Derek
                            ["All glory comes from daring to begin" - fortune cookie]

                            Comment


                            • #15
                              Re: AMS 4 Documentation, lack of examples

                              Actually I did test it, but I developed it with an internal version of AMS 40 that messed up the build configurations a little as a result of some code changes. (Brett's working on speeding up undo/redo and reducing the memory footprint big time.) Go to the Build Configurations tab and delete the 3 empty instances of "Default Build".

                              Meanwhile, I'll upload a fixed version. [img]/ubbthreads/images/icons/laugh.gif[/img]
                              --[[ Indigo Rose Software Developer ]]

                              Comment

                              Working...
                              X