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

Form change when copying from one computer to a second computer

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

    #16
    Re: Form change when copying from one computer to a second computer

    Dear Dave and others,

    With all the changes required when getting reactivated on the second machine, it brings to mind that the Alpha activation process uses the "Computer Name" to track one's licence usage and distribution.

    So it got me to thinking - and given I'm only working between two computers and associated monitors - could one use the system's "Computer Name" together with the "if" function in some way in the autoexec, to say (using simple English for now) something like:

    " if Computer Name = ABC, use FormABC, otherwise FormXYZ. "

    That is if it boots up on Computer ABC, FormABC comes up, and which is the right form for that computer. But if it boots up on the second computer (regardless of computer name even) the second form comes up.

    Obviously Jacks script would seem to work for more or multiple monitors or systems, but with only a two computer/monitor setup, maybe the above " if " function idea might work - or am I missing a lot ????

    Many thanks

    Arthur Cooke

    Comment


      #17
      Re: Form change when copying from one computer to a second computer

      Originally posted by adcooke View Post
      " if Computer Name = ABC, use FormABC, otherwise FormXYZ. "
      Yes

      and consider http://wiki.alphasoftware.com/~alpha...+with+the+Form
      Al Buchholz
      Bookwood Systems, LTD
      Weekly QReportBuilder Webinars Thursday 1 pm CST

      Occam's Razor - KISS
      Normalize till it hurts - De-normalize till it works.
      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
      When we triage a problem it is much easier to read sample systems than to read a mind.
      "Make it as simple as possible, but not simpler."
      Albert Einstein

      http://www.iadn.com/images/media/iadn_member.png

      Comment


        #18
        Re: Form change when copying from one computer to a second computer

        Thank you Alan

        Comment


          #19
          Re: Form change when copying from one computer to a second computer

          One other idea ????

          At the moment, and when using one computer [C1] only I start-up A5 and my application with desired database, from the desktop icon:

          Icon/propertices/Target: "C:\Program Files\A5 ver11\alpha5.exe" "C:\My Documents\COASTWIDE\Alpha 5v11 Dev Data\Coastwide Small\Coastwide - small.adb"
          and
          Icon/Properties/Start in: "C:\My Documents\COASTWIDE\Alpha 5v11 Dev Data\Coastwide Small\"

          When using one computer [C1] only, starts fine and I have the desired start up form [F1] specified within A5 Properties. I also have the second shrunk form [F2] within that database to suit the second computer [C2]. Then when backing up C1 and restoring/transferring all my data to second computer [C2], and obviously both forms go across. But with the extra computer now, I have to manually select the shrunk form F2 - which also work fine. But if I set A5 properties on C2 to start up with the second form F2, the when backing up and restoring on C1 with later data, naturally the start up form will then be F2 on C1 - not desired, but could of course easily reselect the matching form F1. Not a big drama, and it would work, but messy.

          So was wondering if one could use a Form specifier in the Icon Properties 'Target' or 'Start In', along with the database specifier, that starts up the database and the desired form - F1 or F2 - according to the matching "Machine Name" handle ??? This would stay with but differ with each machine, but not be included in the backup/restore process. That way one would not have to reselect forms, but it would start up with the correct matching form for each computer - ie F1 with C1, and F2 with C2.

          I have tried to do this, but can't figure out the correct code or system parameters as yet to do it. Seems like I might be trying to incorrectly mix computer system file info and data, with A5 file info and data???

          Any ideas which might help

          Many thanks

          Arthur Cooke

          Comment


            #20
            Re: Form change when copying from one computer to a second computer

            in autoexec script at the end substitute your own form names.

            Code:
            dim machname as c
            machname = API_GETMACHINENAME()
            if machname = dave1 then
            	form.view("dotimes")
            else
            	form.view("Budget")
            end if
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment


              #21
              Re: Form change when copying from one computer to a second computer

              That was quick - thank you Dave
              Arthur

              Comment


                #22
                Re: Form change when copying from one computer to a second computer

                Hope it works well for you. It is very simple one.
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                  #23
                  Re: Form change when copying from one computer to a second computer

                  Hi again Dave.

                  Well that I’m sure would normally work, but when I created the autoexec script below, it produced a really weird one.

                  My machine are named “ADC-TOSHIBA-PC’ and “EMAHINE-ADC”.

                  When putting either of these into the script:

                  dim machine as c
                  machname = api_getmachinename()
                  if machname = ADC-TOSHIBA-PC then
                  form.view("CWSmall Clnt Simple set")
                  else
                  form.view("CWSmall set for eMachine")
                  end if


                  then it produces an error message saying:

                  “There was an error running the Autoexec script.
                  Variable “PC” not found”.

                  If I swap things around and put in EMACHINE-ADC instead and with corresponding form.view swaps, then it says “Variable ADC not found” in the error message.

                  It seems it does not like having a hyphen before ADC in EMACHINE-ADC, or before the PC in ADC-TOSHIBA-PC.

                  However it doesn’t seem bothered by the hyphen AFTER the ADC in ADC-TOSHIBA-PC.

                  Now whilst this could be easily fixed by re-naming the computers with no hyphens on the one hand, it would I think create a major problem in getting Alpha Software to change the computer names associated with the licensing, so I’d rather not try go there.

                  So I guess I could go back to Jack White’s scripting for “selecting screen size”, but I would much prefer to stay with the above as it is so simple and convenient.

                  Any suggestions ?????

                  Comment


                    #24
                    Re: Form change when copying from one computer to a second computer

                    ADC-TOSHIBA-PC needs to be in quotes

                    if machname = "ADC-TOSHIBA-PC" then
                    Tim Kiebert
                    Eagle Creek Citrus
                    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                    Comment


                      #25
                      Re: Form change when copying from one computer to a second computer

                      Thanks you Tim.

                      I had tried that before my last post, but for some reason still did not work, but now does as the error message does not come up anymoew. However it now just goes straight to the control panel after opening - ie it does not automatically open up the form, as it did when startup form was specified in Settings.

                      I've still got the desired database to be opened specified in the Icon properties. Should that be changed to be in the autoexec script instead?

                      With thanks

                      Arthur

                      Comment


                        #26
                        Re: Form change when copying from one computer to a second computer

                        You may want to run api_getmachinename() from the interactive window to confirm that what the function returns is what you are expecting. Another issue to check is run the form(view) command from the interactive to see if the form opens. I see that you have spaces within your form names which is recommened against. In many instances alpha will replace the spaces with an underscore which results in the name the function ultimately uses not matching what you have named the form.
                        Tim Kiebert
                        Eagle Creek Citrus
                        A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                        Comment


                          #27
                          Re: Form change when copying from one computer to a second computer

                          Thanks Tim, I'll try all that. No trouble to change the Form names.

                          Arthur

                          Comment


                            #28
                            Re: Form change when copying from one computer to a second computer

                            Hi Tim,

                            Running both form.view commands in the interactive window opened the correct forms.

                            But running the API_GETMACHINENAME() in the interactive window produced absolutely nothing, either with or without the " dim machname as c ' in front of it or not ! Very surprising, given it was looking so elegant and simple.

                            So where to from here??

                            Many thanks
                            Arthur

                            Comment


                              #29
                              Re: Form change when copying from one computer to a second computer

                              Further note: As you can gather, I'm not much on XBasic, but I notice ' machname ' does not come up in any Alpha Help Files search of recognised variable names; should one be using straight out ' machinename ' instead of ' machname ' ??? Definitely no disrespect to Dave !!!

                              OR.....

                              is ' API_GETMACHINENAME() ' not working because I'm expecting MACHINE NAME to be the same as COMPUTER NAME, which may not be valid. I'm specifying COMPUER NAMEs in the autoexec. It doesn't show or specify MACHINE NAME in the Windows System Properties window, only COMPUTER NAME.

                              I say this because such details often need to be very exact in computer programing terms.

                              Arthur
                              Last edited by adcooke; 11-08-2014, 10:41 AM.

                              Comment


                                #30
                                Re: Form change when copying from one computer to a second computer

                                I just ran this on a production adb to test it again.

                                In the interactive window:

                                dim machname as c
                                machname = API_GETMACHINENAME()


                                select the above and run it.
                                Then type the below and press enter

                                ?machname
                                = "DAVE1"

                                should give you the computer name.
                                It does this on all my win7 and win8 machines.

                                Code:
                                dim machname as c
                                machname = API_GETMACHINENAME()
                                if machname = "dave1" then
                                	form.view("dotimes")
                                else
                                	form.view("Budget")
                                end if
                                machname is just a variable, you won't find it in the help files.
                                Dave Mason
                                [email protected]
                                Skype is dave.mason46

                                Comment

                                Working...
                                X