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

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

    XBasic

    Hi all
    I am a bit stuck in x-basic

    I have a development environment and a live running environment. I am trying to automatically update the development environment data out of the live data (or a backed up copy of it). I wrote an xbasic script to try and compare the structures of the two environments but I am having hassles.
    I was thinking of building a multi dimentional array with the structures of the two and comparing them, Does anyone have any ideas on how to do this?
    Thanks

    #2
    Re: XBasic

    If this is not a web app server question, I can tell you how I do this for my desktop apps.

    Disclaimer: I do not know how to "automate" this sequence.

    1) Find and print the help topic "Alpha Five File Types". This tells you where your design elements are stored on disk.

    2) As you work on your app keep track of the changes you make so you can identify the "dictionaries" that now contain "new" material.

    3) When you want to update the live database follow this sequence:
    - shut down alpha five on all workstations, except the one you're using
    - create a backup of the live database before changes are installed
    - copy the new dictionaries into the database folder
    - optionally compact the database
    - create a new backup of the live database after changes are installed; this copy can then be downloaded to your development machine and becomes the base upon which future changes are built.
    - if the workstations are running shadow copies of an optimized database all the foregoing work must be done on the server, and then the workstation shadow copies must be "refreshed". In cases where you change DBF structures or CDX definitions a shadow refresh is inadequate, you must "network optimize" the workstations anew. Changing DBF structures obviously cannot be done by copying your development copy of the DBF to the server. To do so would be to wipe out (overwrite) the live data. So I change the DBF spec by hand on the server. Similarly, special care must be taken when changing CDX (index) definitioins for a table. You can copy the CDX file from your development machine, but if you do you must remember to update the indexes for the table afterward.
    - and, further complications are present if your customer is using Alpha Five's security functions to control access to the database. Users, groups, and passwords are stored in the database dictionaries. If you copy those dictionaries from your development machine to the database folder you will wipe out (overwrite) any recent changes the user may have made for users, groups or passwords.

    NOTE: - I'm assuming the database is entirely located within a single folder. No subfolders or external drives or folders are being used
    - When copying dictionaries be sure to include all the related dictionary files. Do not for example, copy the .DDD file for a table without also copying the .DDM and .DDX files. They are a matched set and must "travel" together always.
    Last edited by Tom Cone Jr; 01-24-2012, 08:48 AM.

    Comment


      #3
      Re: XBasic

      Hi Tom, thanks a lot for your suggestion, it has te be an automated process though, copying the data is not so much of a hassle, the problem comes in with structure changes in the development environment in comparison to the data in the live environment, but I will investigate and experiment a little more

      Comment


        #4
        Re: XBasic

        study the methods for using xbasic to change the field names, sizes, add fields to a table, etc. then you can keep track of the version, and run a script to auto update the tables in the autoexec
        Cole Custom Programming - Terrell, Texas
        972 524 8714
        [email protected]

        ____________________
        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

        Comment


          #5
          Re: XBasic

          Take a look at this earlier post of mine in the V9 forum. If you follow that method, including ALWAYS adding new fields at the end of the table, it should solve your problem. And, yes, it still applies to v11.

          Two comments after re-reading the sample in that post:

          1. The PleaseWait_fnc() is something I created based on a PleaseWait function in the Code Archive. You will either have to find the PleaseWait function in the Code archive, use your own "wait" message (perhaps with a "waitdialog"), or remove the "wait" message altogether. (Note that there is a second call to close the "wait" message at the end.) (Some of the xbasic_wait_for_idle() commands, etc. are there to make the wait message show up correctly. It seems to be necessary in some versions of A5 and not in others so I just leave it in all the time.)

          2. At the very bottom of the function, you will see a call to the function that is after the END FUNCTION line. This is there so I can test the function by clicking the lightning bolt icon when working in the Code Editor. If there is any code BEFORE the initial "FUNCTION" definition line, then the test in the Code Editor will work but A5 will not see any changes to your function when called from a form or another script/function until you close the app and re-open it. (Or maybe you just have to close the code editor and re-open it - it's been so long since I've done that that I don't remember for sure.) However, if the other/test code is AFTER the "END FUNCTION" line, A5 will see all edits immediately. (Assuming, of course, that you didn't forget to save your changes - BTDT.) Of course, any code outside the FUNCTION ... END FUNCTION section will only run from the code editor; it won't run when the function is called from somewhere else.
          Last edited by CALocklin; 01-29-2012, 12:48 AM.

          Comment


            #6
            Re: XBasic

            Hope I am reading your question correctly!

            did you try the operations append table? Running these from your development environment should do the trick. Yes, if you change a field name, it is more work. It can still be done if you just keep a record of your changes to field names/table names.

            Once you stabilize field names and table names, a script to run the append operations will do the trick. Or make the appropriate code to do it.

            I have been doing what you are attempting for years.

            To put the new back on the server for use, I make sure NO ONE is using it, run the appends to get current data, change the version so all workstations will get updated and copy all or affected files back to the server. Make sure you have a proper backup of both environments before you start, just in case.
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment


              #7
              Re: XBasic

              After reading DaveM's reply, I should add that my method works great if you are adding fields or changing a field size (especially well for generic apps where you don't have much control over what the user is doing) but it doesn't work very well if you have to change a field name.

              Changing field names can be done but it's a pain and I'd rather do it manually. On the other hand, I'd also say that changing field names in a production app should be really rare, should only happen in the initial development stage, and as a "one time deal" can be handled manually.

              Also, maybe I should point out that with my method you simply copy the existing data files (dbf/cdx/fpt) to your program folder and restart the app - all new fields will automatically be created. And, using my method means that users can also restore old backups to a new application and it will still work.

              FWIW, I know a lot of people don't often think about restoring old backups but I just had another customer ask me last week how she could reprint an old report that she had lost. It was a year-end report from 2010. It was easy - make a current backup, restore the year-end backup (I insist that my customers keep monthly and year-end backups for quite awhile), run report, restore current backup. The total time was about 5 minutes. (She could actually have done it herself but, like many users, was afraid to do it on her own.) The time required to figure out how to use the current data and make sure I was only looking at the correct records would have been MUCH longer because many work orders can span the year-end thus be started but not completed at any given point in time. In fact, the odds are very good that I would have missed something and it wouldn't have been quite accurate.

              Comment

              Working...
              X