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

Switch Between Applications

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

    Switch Between Applications

    Hello

    As part of our standard demonstration procedure to prospective clients I want to be able to be able to switch between one application (database) and another.

    If I have a button on a button on application 1, (launch another A5 database) it opens up another application, but closes down the one I launched the application from.

    Is there any way I can launch the database and then on closing it, return to my original one?

    Any help would be appreciated.

    Alex
    Database Software Solutions Limited
    www.dbasesolution.co.uk
    http://www.precise360.co.uk
    PRECISE360 -
    LYNCHPIN -

    #2
    Re: Switch Between Applications

    Possibly try sys_shell("alpha5.exe")
    with your folder parameters to open another a5 app without closing the one that called it?

    Comment


      #3
      Re: Switch Between Applications

      I haven't tried this, but try stringing ON_DATABASE_EXIT() and A5.LOAD()... I think it will work.

      Comment


        #4
        Re: Switch Between Applications

        I just looked at A5.LOAD(). The example has an error in it.

        In the example, cDB is declared, but not defined.

        If you use that snippet of code, then prior to the If statement in the example, add

        cDB = "thepathofyourdatabase"

        Comment


          #5
          Re: Switch Between Applications

          Also be sure to specify or get the title so you can use a button to switch between the open adb's without error and / or test if it is already open.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #6
            Re: Switch Between Applications

            Alex,

            If memory serves, Tom Henkel is supporting an application that does this sort of thing. He's active on the board and has posted messages on this topic. Try searching for the message threads, or drop him a line.

            -- tom

            Comment


              #7
              Re: Switch Between Applications

              Originally posted by alexmuir View Post
              Hello

              If I have a button on a button on application 1, (launch another A5 database) it opens up another application, but closes down the one I launched the application from.

              Is there any way I can launch the database and then on closing it, return to my original one?

              Any help would be appreciated.

              Alex
              May I ask why other than to look good in front of a perspective customer? I mean is there a program flow logic that must work that way?

              If you just need to open up several databases then Alpha will allow you to have as many open at the same time as you want as long as they are not the same adb file. Then you can just click through them from the Windows start bar.

              Comment


                #8
                Re: Switch Between Applications

                We do switch from one adb to another, and another, and another, then back again within the same Alpha window. We present a common "Menu" database that "Calls" the other adb's when the user "signs in". We do this because our internal security keeps track of the user so that we know who did what and when to the data. This system was devised long before Alpha had reasonable security, and there is no reason to change now. We use addin variables to keep track of where we are going and where we came from. The a5.load() is populated with the appropriate variable, and the transition is fairly elegant. I'm pretty sure I posted this in the code archive, but if you can't find it, I will gladly post it again.

                Thanks for the plug, Tom.

                Tom

                Comment


                  #9
                  Re: Switch Between Applications

                  Thanks for your input.

                  May I ask why other than to look good in front of a perspective customer?

                  In some industries ie engineering, the question of tracking by parts serial number can be common to most manufacturers. How the serial number is generated can be different. By opening up multiple applications, it enables the prospect to see his specific way being done.

                  I take your point about the start bar, and having tried it, this can get get quite cumbersome.

                  I was looking for a more polished way

                  Thanks for your input.
                  Database Software Solutions Limited
                  www.dbasesolution.co.uk
                  http://www.precise360.co.uk
                  PRECISE360 -
                  LYNCHPIN -

                  Comment


                    #10
                    Re: Switch Between Applications

                    Tom.

                    Your approach is what I am looking for.

                    Can I have a copy of the code please?

                    Thanks for your help. It is very much appreciated.

                    Kind regards

                    Alex
                    Database Software Solutions Limited
                    www.dbasesolution.co.uk
                    http://www.precise360.co.uk
                    PRECISE360 -
                    LYNCHPIN -

                    Comment


                      #11
                      Re: Switch Between Applications

                      Originally posted by alexmuir View Post
                      Can I have a copy of the code please?
                      Ditto..

                      Comment


                        #12
                        Re: Switch Between Applications

                        Here we go...

                        Callsub is used to "call" a sub application and save the current application's name in an array called aa.bcbss.applvl. It is used for making sure we get back to where we came from.

                        Code:
                        'Date Created: 19-Mar-2003 10:18:41 AM
                        'Last Updated: 20-May-2011 11:41:00 AM
                        'Created By  :
                        'Updated By  : Thomas Henkel
                        FUNCTION callsub AS C (subapp AS C,path=" ")
                        'Function callsub is used to determine whether to use the shadowed database when calling 
                        'a sub application or to use the main database
                        '  parameter subapp has the format of "folder\appname"  leave off the ".adb" I will insert it.
                        '									ie:      supply\stockroom
                        '	parameter path is to tell where we are going to go.  "P" in path means to use "personnel" path
                        '		 - aa.bcbss.ppath instead of aa.bcbss.path
                        'debugcheck()
                        dim aa as P
                        aa = addin.variables()
                        dim aa.bcbss as P
                        dim aa.bcbss.appname[10,2] as C
                        dim aa.bcbss.applvl as N
                        dim aa.bcbss.subapp as C
                        'Set up name of Calling Application
                        dim aa.bcbss.calling as C
                        dim shared filename as C
                        dim filename1 as C
                        dim path as C
                        dim global mpath as C
                        
                        aa.bcbss.calling = a5.Get_Name()
                        	if path = "P"
                        		filename1 = aa.bcbss.lppath+chr(92)+subapp+".adb"
                        	  else
                        	  	filename1 = aa.bcbss.lpath+chr(92)+subapp+".adb"
                        	end if
                        	'filename1 = aa.bcbss.path+chr(92)+subapp+".adb"
                        '	if access=19
                        '		filename1 = "C:\Program Files\A5V5\Shadow\Personnel\\"+subapp+".adb"
                        '	end if
                        	if ut(path) = "P"         'see if we have a shadow of Personnel
                        		if file_exists(aa.bcbss.lppath+chr(92)+subapp+".adb")
                        			filename = aa.bcbss.lppath+chr(92)+subapp+".adb"
                        		  else
                        		  	filename = aa.bcbss.ppath+chr(92)+subapp+".adb"
                        		end if		
                        	  else if ut(path) = "C"		'Added for testing.
                        		if subapp = "Personnel"
                        			filename = "C:\Personnel\Local"+chr(92)+subapp+".adb"
                        		  else if subapp = "Homemaker"
                        			filename = "C:\Homemaker\Local"+chr(92)+subapp+".adb"
                        		  else
                        			filename = "C:"+chr(92)+subapp+".adb"
                        		end if
                        	else
                        	  	filename = aa.bcbss.drive+chr(92)+subapp+".adb"
                        	end if
                        	if file_exists(filename1)
                        		filename = filename1
                        	end if
                        	aa.bcbss.subapp= filename
                        '	dim good as N
                        '	good = 0
                        '	good = aa.bcbss.appname.find(aa.bcbss.calling)
                        '	if aa.bcbss.applvl >1
                        		dim nextlvl as N
                        		nextlvl = aa.bcbss.applvl+1
                        		aa.bcbss.appname[aa.bcbss.applvl,1] = aa.bcbss.calling
                        		aa.bcbss.appname[nextlvl,2] = aa.bcbss.whereto
                        '	end if
                        	aa.bcbss.applvl = aa.bcbss.applvl +1
                        	'Clear out existing scheduled scripts to "scpCheck_Closeit".
                        '	for j = 1 to 10
                        '		if script_schedule_name_get(j) = "scpCheck_Closeit"
                        '			script_schedule("","",j)
                        '		end if
                        '	next j
                        END FUNCTION
                        Setup has a pretty good explanation;

                        Code:
                        'Date Created: 27-Nov-2002 11:50:43 AM
                        'Last Updated: 20-May-2011 11:41:19 AM
                        'Created By  : Tom Henkel
                        'Updated By  : Thomas Henkel
                        'FUNCTION "SETUP" INITIALIZES THE VARIABLES TO BE SENT TO THE CALLED APPLICATION.
                        '	THE CHARACTER PARAMETER "appname" IS THE NAME OF THE CALLED APPLICATION AND IS WHAT IS
                        '		PLACED INTO THE AA.BCBSS.WHERETO SUPER-GLOBAL VARIABLE  
                        '		THE CHARACTER VARIABLE "FORMNAME" IS THE NAME OF THE FORM IN SOCIAL SERVICES 
                        '		THAT CALLED THE NEW APP.  IT IS USED TO DETERMINE WHICH FORM TO OPEN UPON RETURN
                        '		THE VARIABLE "RETN" IS USED TO TOGGLE THE "RETURN" MENU ITEM ON/OFF
                        FUNCTION setup AS V (appname AS C, formname as C )
                        	'debugcheck()
                        	dim aa as p
                        	aa= addin.variables()
                        	dim aa.bcbss as P
                        	dim Global Retn as C
                        	Retn = "X"
                        	aa.bcbss.wherefrom = formname
                        	aa.bcbss.whereto = appname
                        END FUNCTION
                        Returnmain determines if the user has a shadow or if we need to bring back the ddatabase from the server. It uses the applvl array to determine how far back to go. I set the array to 10 items. If we go deeper than 10 applications, shoot us.

                        Code:
                        'Date Created: 05-Nov-2003 10:00:30 AM
                        'Last Updated: 20-Oct-2015 09:57:55 AM
                        'Created By  : Tom Henkel
                        'Updated By  : Stephen Andrews
                        FUNCTION returnmain AS V ( )
                        'debugcheck()
                        dim aa as P
                        aa = addin.variables()
                        dim filename as C
                        if aa.bcbss.applvl = 1
                        	'we're already at the main menu, no need to go through the nonsense
                        	parentform.Close()
                        	end
                        end if
                        dim ans2 as N
                        if aa.bcbss.applvl = 2
                        	ans2 = 6
                        else
                        	ans2 = ui_msg_box("Question","Do you want to return to the Social Services Main Menu?",292)
                        end if
                        	if ans2 = 6
                        		parentform.Minimize()
                        '		*****  Removed for testing so that we don't use the shadows  *****		
                        		if file.exists(aa.bcbss.lpath+chr(92)+"Socsvcs.adb")
                        			'use runtime version
                        '			filename1 = aa.bcbss.path+chr(92)+"Socsvcs.adb"
                        '			filename = aa.bcbss.path+chr(92)+"Socsvcs.adb"
                        			filename1 = aa.bcbss.drive+chr(92)+"Socsvcs.adb"
                        			filename = aa.bcbss.drive+chr(92)+"Socsvcs.adb"
                        		  else
                        			filename1 = aa.bcbss.appname[1,1]
                        			filename = aa.bcbss.appname[1,1]
                        		end if
                        		if aa.bcbss.applvl = 2 .and. (aa.bcbss.wherefrom = "" .or. aa.bcbss.wherefrom = "Main Menu")
                        			aa.bcbss.wherefrom = "Main_Menu"
                        		end if
                        		'added 01/23/06 to make sure we open up the main menu on return from the hinterlands
                        		if aa.bcbss.applvl > 2 
                        			aa.bcbss.wherefrom = "Main_Menu"
                        		end if
                        		'************************************************************************************
                        		if file_exists(filename1)
                        			filename = filename1
                        		end if
                        		PleaseWait(.T.,"Returning to Social Services Main Menu...")
                          	  else
                        		if aa.bcbss.applvl = 1
                        			parentform.Close()
                        			end
                        		end if
                        		filename1 = aa.bcbss.appname[aa.bcbss.applvl-1,1]
                        		filename = aa.bcbss.appname[aa.bcbss.applvl-1,1]
                        		aa.bcbss.applvl = aa.bcbss.applvl-1
                        		if file_exists(filename1)
                        			filename = filename1
                        		end if
                          		aa.bcbss.whereto = aa.bcbss.appname[aa.bcbss.applvl,2]
                          		PleaseWait(.T.,"Returning to "+alltrim(aa.bcbss.whereto)+" "+strtran(aa.bcbss.wherefrom,"_"," ")+"...")
                          	end if
                        
                        :a5.Load(filename)
                        'debug(0)
                        END FUNCTION
                        These are the functions we use. They are obviously highly customized to our environment.

                        Review them use them, but you will absolutely need to tailor them to your specific environments.

                        Below is an example of how we use the "setup" and "callsub" functions under a button on our main menu to "call" (load) our client information database from our main menu database.

                        Code:
                        'Date Created: 27-Nov-2002 11:53:40 AM
                        'Last Updated: 03-Mar-2015 02:56:18 PM
                        'Created By  : Tom Henkel
                        'Updated By  : Thomas Henkel
                        dim aa as p
                        aa = addin.variables()
                        dim filename as C
                        'if level = "A"
                        '	debugcheck2("TEST1")
                        'end if
                        'FUNCTION "SETUP" INITIALIZES THE VARIABLES TO BE SENT TO THE CALLED APPLICATION.
                        '	THE CHARACTER PARAMETERS ARE THE NAMES OF THE CALLED APPLICATION AND THE FORM
                        '	WE ARE COMING FROM. THEY ARE PLACED INTO THE AA.BCBSS.WHERETO AND AA.BCBSS.WHEREFROM
                        '	SUPER-GLOBAL VARIABLES
                        
                        'FUNCTION CALLSUB IS USED TO DETERMINE IF A SHADOW DATABASE EXISTS, AND IF SO,
                        '	CALL THE LOCAL COPY OF THE DATABASE INSTEAD OF THE NETWORK MASTER.  INFORMATION 
                        '	PASSED IS THE SUBFOLDER NAME AND APPLICATIN NAME.
                        '  VARIABLE AA.BCBSS.SUBAPP CONTAINS A TEXT STRING IN THE FOLLOWING FORMAT:
                        '		aa.bcbss.lpath+chr(92)+subapp+".adb"  OR
                        '		aa.bcbss.path+chr(92)+subapp+".adb"
                        ' 	WHERE AA.BCBSS.LPATH AND AA.BCBSS.PATH ARE FULLY QUALIFIED PATH NAMES TO EITHER THE 
                        '	SHADOW DATABASE(lpath) OR THE NETWORK DATABASE(path)
                        
                        '------- This controls the availability of Buttons ---------------------
                        DIM Shared Form_Name AS c
                        DIM SHARED Button_Name AS c
                        Button_Name = topparent.active()
                        Form_Name = topparent.name()
                        
                        if IsHidden(Form_Name,Button_Name)
                        	msg = "The requested feature is currently unavailable.  Check back later."
                        	ui_msg_box("UNAVAILABLE",msg,UI_OK+UI_ATTENTION_SYMBOL)
                        	END
                        end if
                        '-----------------------------------------------------------------------
                        
                        setup("Customer Information","Main_Menu")
                        callsub("Casereg\Client_info")
                        pleasewait(.T.,"Retrieving Customer Info Menu... ")
                        'Open database:
                        :A5.load(aa.bcbss.subapp)
                        Good luck and have fun,

                        Tom

                        Comment

                        Working...
                        X