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

Alpha4 to Alpha5 - Script Variables

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

    Alpha4 to Alpha5 - Script Variables

    HELP....

    I have several fairly complex applications which run beautifully in Alpha 4 V6. I need to get these running in Alpha 5 V 4. I have the latest version, and have downloaded the latest patches - as of today.

    Here is my problem.

    In Alpha4, I relied heavily on script variables which hold redundant information for use through out the application. Although these could be contained in a table, that would require me to change every set to include that table. These are mostly used as headers in reports, however, some are used as filters for indexes, and are changed by dialog scripts.

    Is there anything in Alpha 5 which will simulate the use of dialog boxes short of using Visual Basic.

    Any help will be greatly appreciated. I have hit a wall and am unable to proceed until I find a solution to this dilema.

    Please reply to [email protected] or post a reply here.

    Thanks,

    Jimmy Johnson

    #2
    RE: Alpha4 to Alpha5 - Script Variables

    Hi Jimmy,
    >>In Alpha4, I relied heavily on script variables >Is there anything in Alpha 5 which will simulate the use of dialog boxes short of using Visual Basic

    Comment


      #3
      RE: Alpha4 to Alpha5 - Script Variables

      Having never used any prior version of Alpha (non windows) don't be offended if I ask if you have investigated the "ui_get...." methods. These would seem to be the answer to what you want for dialog boxes. You are also allowed to set set, form, browse, report, etc variables of various "scopes".
      There can be only one.

      Comment


        #4
        RE: Alpha4 to Alpha5 - Script Variables

        Thanks for the tips. I must be missing something though, because I a having trouble at the most basic of points. I have looked through the documentation, both printed and on line, and cannot seem to find how to open a form in dialog mode.

        Also, one other thing I forgot to mention. In each of the applications in A4, I begin with a script which opens a table, displays the information on screen, then reads each position by location into a script variable. Is there a way to place the data from the table into global variables at start up time, rather than have the user key in the information each time? In A4, I did this with the screen in freeze mode so that nothing actually displayed.

        As you can see, I am really new to A5, but am convinced this is where I want to put my applications.

        Thanks Again
        Jimmy Johnson

        Comment


          #5
          RE: Alpha4 to Alpha5 - Script Variables

          Thanks for the tips. I must be missing something though, because I a having trouble at the most basic of points. I have looked through the documentation, both printed and on line, and cannot seem to find how to open a form in dialog mode.

          Also, one other thing I forgot to mention. In each of the applications in A4, I begin with a script which opens a table, displays the information on screen, then reads each position by location into a script variable. Is there a way to place the data from the table into global variables at start up time, rather than have the user key in the information each time? In A4, I did this with the screen in freeze mode so that nothing actually displayed.

          As you can see, I am really new to A5, but am convinced this is where I want to put my applications.

          Thanks Again
          Jimmy Johnson

          Comment


            #6
            RE: Alpha4 to Alpha5 - Script Variables

            140 Alpha Five Xbasic Reference Manual
            Form.dialog()
            Syntax:
            Last_Button = Form.Dialog( Form Name, [ Window Name])
            Description:
            Opens Form Name as a dialog box. When the user closes the dialog, the object
            name of the last button pressed is stored in Last_Button. See �Working with
            Dialog Boxes� below for more information.



            Form.view()
            Syntax:
            = Form.view( Form Name, [ Style], [ Window name])
            Description:
            Opens Form Name and returns an object pointer, , to the form window.
            In the case where there are duplicate form names in the database, you can qualify
            the form name with the table name using this syntax: Form Name@Table Name.
            For example, if a database has a form called �Customers� for the
            �Current_Customers� and the �Past_Customers� tables, you can specify the form
            as: �Customers@Current_Customers�, or �Customers@Past_Customers�.
            To open the form as a modal dialog box, specify �Dialog� as the optional Style
            parameter. See �Working with Dialog Boxes� for details.
            Alpha Five Xbasic Reference Manual 141
            To open the form as a popup window, specify �Popup� as the optional Style
            parameter. If a form is opened using the �Popup� style, the following rules
            apply:
            � Xbasic does not pause, as it does in the case of �Dialog� style.
            � The window can be moved outside of the Alpha Five frame.
            � Alpha Five menus are not active (just like �Dialog� style).
            � The window is not modal. (unlike �Dialog� style).
            � The window is always on top of all other Alpha Five windows.
            When Alpha Five opens the form it tries to name the window the same as the
            form name. If a previous instance of the form is already open, then Alpha Five
            will assign a unique name to the window by adding a digit to the end of the form
            name. You can explicitly assign the window name by specifying the Window
            name.
            NOTE: It is not required to create an object pointer to reference the new form
            window. For example the following code fragments show that you can address
            the form window either by the window name, or by an object pointer.
            'Using the window name:
            :form.view("customers")
            :customers.maximize()
            'Using the object reference
            f = :form.view("customers")
            f.maximize()
            If you opened a form, but did not assign an object pointer at the time you opened
            the form, you can still get an object pointer reference to the form using the obj()
            command. For example:
            :form.view("customer")
            f = obj(":customer")
            To load the form into memory, without displaying it, use the form.load()
            method.
            Debugging Aid
            When a form loads, any OnInit and OnActivate scripts that are defined for the
            form execute. This can make debugging an application tricky. By specifying a
            special keyword for the Style parameter, you can load the form without having
            the scripts execute. For example:
            frm = form.load(�customer�, �SCRIPT_DISABLE_EXEC�)
            Examples:
            'This script opens the Customer form and then maximizes the
            'form and adds a new record.
            '---------------------------------------------------------
            :form.view("customer")
            :customer.maximize():customer.new_record()
            :customer:last_name.value = "Smith"
            :customer:first_name.value = "John"
            :customer.commit()
            See Also:
            Form.load(), Browse.view(), Browse.load()
            Testing if a Form or Browse is Already Open
            It is often necessary in an Xbasic program to test if a form or browse window is
            already open. To do this, use the is_object() function.
            For example, the following command tests if a form called �Customers� is
            already open. If not, it opens the form. If it is open, it gives focus to the form.
            IF is_object(customers.this) THEN
            'form is open
            :customers.show() 'show the form
            :customers.activate() 'give focus to the form
            :customers.restore() 'restore window size in case
            'user minimized window
            ELSE
            :form.view("customers") 'open the form
            END IF
            NOTE: The is_object() function takes an object pointer as an argument. The
            .this property of an object address is used to return an object pointer.


            There can be only one.

            Comment


              #7
              RE: Alpha4 to Alpha5 - Script Variables

              You really don't need to read a table to do the variables setup. On your main form for your application go to design mode, properties, variables, and define your constants as "global" variables. They will be available as long as Alpha is open.

              If you distribute copies of your application to maore than one user base and need different versions of the variable contents, just change the variables before you make a copy for the client, then change back after the copy is made.
              There can be only one.

              Comment


                #8
                RE: Alpha4 to Alpha5 - Script Variables

                Jimmy,

                You will find a lot of help at Dr. Wayne's web site at

                http://www.learn alpha.com/

                He has all sorts of articles posted there that may help you over some hurdles. I experienced the same in adjusting from A4 to A5. Some basic concepts, such as pointers, methods, etc. were hard for me to grasp (and still are). I found the books by Dr. Wayne sold by Alpha Software to be a big help. Also, check out Alpha Forum at

                http://www.alphaforum.com/

                There is a series of articles by Jim Chapman that are a big help in understanding the basic concepts in A5.

                Comment


                  #9
                  RE: Alpha4 to Alpha5 - Script Variables

                  Hi Richard,

                  >>There is a series of articles by Jim Chapman that are a big help in understanding the basic concepts in A5

                  Comment


                    #10
                    RE: Alpha4 to Alpha5 - Script Variables

                    Jim,

                    I found them very helpful. It could have been the "venue". Since Alpha Forum's subscription was pretty steep, I think beginners would shy away from it. I know I did since my employer wouldn't pay for it, although I knew it would help me (we were using A4 then). Maybe if the articles were available somewhere else as well, more beginning users would find them. I found them to be a good compliment to Dr. Wayne's books as they provided a different perspective.

                    Sorry, this got off Jimmy's thread.

                    Comment


                      #11
                      RE: Alpha4 to Alpha5 - Script Variables

                      "I had such precious little feed back on this...."

                      Jim:

                      This surprises me. So let me say that I found the series to be invaluable as it attempted to be a systematic presentation of the program as opposed to worked out examples which, of course, are also useful.

                      Bill
                      Bill Hanigsberg

                      Comment


                        #12
                        RE: Alpha4 to Alpha5 - Script Variables

                        Jimmy, are you using the A4 variables to store constant values - i.e., these variables ALWAYS have the same value when the application is started? If so, you can use the global variables mentioned above.

                        However, if I recall correctly, the A4 variables can be changed and the changes will be stored even after the program is shut down. If this is the result you need, I don't know of an easy way in A5. I haven't actually done it but I think it could be done with Xbasic by either copying the value to another table or by copying it to a simple text file and then reading it into a variable when the application is started.

                        I know I have discussed this with Bill Warner in the past but don't recall the final result. Bill is out of town until the middle of next week. In the meantime, IF this is the function you need, leave a post here and I'll work on it.

                        Comment


                          #13
                          RE: Alpha4 to Alpha5 - Script Variables

                          Hi Cal et al:

                          You recall correctly. The vrestore and vsave commands in A4 allow variables to be saved at the end of a session and initialized when a new one starts. They are saved to a text file. I actually replicated this method in A5 in an early application I wrote and it does work. But, as you know,the better (and easier) way to do this in A5 is to save your variables to a little table (defaults.dbf or some such). When a new session begins you can read them out of the table. The beauty of this is that you can save different defaults one for each user which is handy if you have multiple users.

                          So, Jimmy, what exactly do you want to do?

                          Bill
                          Bill Hanigsberg

                          Comment


                            #14
                            RE: Alpha4 to Alpha5 - Script Variables

                            Bill,

                            Thanks for the input. I think you have finally put me on the right track.

                            The primary task is to take a set of field values contained in a table and place these in global variables at the time the application is initialized. I would rather not "hard code" in the global variables because this table contains the name, address etc of the target users of my application, and such an approach would require me to modify the app for each user who wants to use it.

                            In Alpha 4, all I did was freeze the screen, display the table in a form and read the screen locations into script variables which were then available throughout the app as long as it ran. If it ended and was restarted, the same variables were set up, so the user did not have a problem.

                            It looks to me like x-basic is where I will need to go to get this task accomplished, so I am beginning to get familiar with it.

                            Any other help you can give would be much appreciated.

                            Jimmy

                            Comment


                              #15
                              RE: Alpha4 to Alpha5 - Script Variables

                              Cal,

                              Thanks for your input.

                              I left the post under Bill's response showing the problem I am trying to solve. If you can offer any suggestions, I would be very appreciative.

                              Jimmy

                              Comment

                              Working...
                              X