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

Operation to script

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

    Operation to script

    We have designed a operation we would like to know how can we make it for a scipt to be able to use to any database or alb?
    we went in xbasic & saved the script but what's next?

    #2
    Re: Operation to script

    Originally posted by lkatz1 View Post
    We have designed a operation we would like to know how can we make it for a scipt to be able to use to any database or alb?
    we went in xbasic & saved the script but what's next?
    Go to the code tab. Right click on the script and choose Design. Copy all of the text to a word processor document. You can now paste from the word processor document to any Alpha script.

    there are quicker ways to do this if the other databases are on the same machine or connected on a network but you didn't indicate that they were.
    There can be only one.

    Comment


      #3
      Re: Operation to script

      Is there a quicker way to do this if the other databases are on the same machine?

      Comment


        #4
        Re: Operation to script

        Originally posted by lkatz1 View Post
        Is there a quicker way to do this if the other databases are on the same machine?
        Managing Addins
        Background Information
        An Addin is a special library of scripts and functions.

        Alpha Five stores global scripts and functions in a library file (an .alb file) of the same name as the Database file (the .adb file).

        Normally, the scripts and functions that you create in a Database are only available when that Database is open. If you have created a library of scripts and functions that you want to use when another Databse is open, you can attach the script library to that Database (using the File, Database Properties command).

        Alpha Five also allows you to compile the scripts and functions in a library into a special Compiled Script Library (which has an .aex extension).

        Like scripts and functions in an .alb file, a Compiled Script Library can also be attached to a Database (using the File, Database Properties command).

        However, unlike the scripts and functions in a .alb file, a Compiled Script Library can be made into an Addin. The scripts and functions in an Addin are universally available, regardless of what Database is currently open. In effect, the scripts and functions in an Addin are "part of" Alpha Five.

        To make a Compiled Script Library into an Addin, you simply copy the .aex file into the "addins_installed" folder under the Alpha Five program folder. In addition to the "addins_installed" folder, Alpha Five also has an "addins_disabled" folder under the main Alpha Five program folder. The .aex files in this folder are the Addins that have been temporarily disabled.

        Using the Addin Manager
        To open the Addin Manager dialog box, select the Tools, Addin Manager... command.

        Alpha Five displays the Addin Manager, showing both the currently installed Addins, and the disabled Addins. The installed Addins have a check in the box to their left.

        Using this dialog you can easily install any disabled Addins, or disable any installed Addins. You do not need to restart Alpha Five after changing the list of installed Addins.

        Addins provide a powerful mechanisim for developers to add new features to Alpha Five itself.
        There can be only one.

        Comment


          #5
          Re: Operation to script

          We use generic scripts and functions in our system all the time. We have a main, calling database that contains these scripts and functions. In our othe databases, we just include this library using the database properties->libraries tab. see attached. This will then include all of the scripts and functions from the added database library in the current database.

          Notice the scripts and functions in the code tab on the second attachment.

          Hope this helps.

          Tom

          Comment


            #6
            Re: Operation to script

            Still don't understand if the script has a dbase name in the script ex :a_tbl = table.open("check")
            how will it work on other dbase

            Comment


              #7
              Re: Operation to script

              David,

              May I suggest you post your full script up here? It would make more sense if we new what it did. If it is table specific, it would be hard to move to another db with diff tables and if fields are used, it can become real tough. If you are using variables and/or certain things fall right, a udf may be more appropriate(usually is).

              Dave Mason
              Dave Mason
              [email protected]
              Skype is dave.mason46

              Comment


                #8
                Re: Operation to script

                'Date Created: 17-Jul-2007 11:32:54 AM
                'Last Updated: 18-Jul-2007 11:37:21 PM
                'Created By :
                'Updated By :
                a_tbl = table.open("check")
                DIM a5_operation_order as C
                a5_operation_order = ""
                query.order = a5_operation_order
                DIM a5_operation_filter as C
                a5_operation_filter = ".T."
                query.filter = a5_operation_filter
                query.options = "I"
                query.description = "Temporary Query"
                i_indx = a_tbl.query_create()

                update.fields = 5
                update.field1 = "FIRST"
                update.expr1 = "IF(UT(WORD(NAME,1))<>\"MR\".AND.UT(WORD(NAME,3))<>\"MRS\".AND.UT(WORD(NAME,1))<>\"MS\".AND.UT(WORD(NAME,1))<>\"MISS\".AND.UT(WORD(NAME,1))<>\"DR\".AND.UT(WORD(NAME,1))<>\"REV\".AND.W_COUNT(NAME)>1.AND.ATC(\",\",NAME)=0,WORD(NAME,1),IF(W_COUNT(NAME)<3.OR.((UT(WORD(NAME,1))=\"MR\".OR.UT(WORD(NAME,1))=\"MRS\".OR.UT(WORD(NAME,1))=\"MS\".OR.UT(WORD(NAME,1))=\"MISS\".OR.UT(WORD(NAME,1))=\"DR\".OR.UT(WORD(NAME,1))=\"REV\").AND.ATC(\",\",NAME)>0.AND.W_COUNT(NAME)=3),WORD(NAME,2),WORD(NAME,4)))"
                update.field2 = "MID"
                update.expr2 = "if(w_count(NAME)>5,word(NAME,5),\"\")"
                update.field3 = "LAST"
                update.expr3 = "IIF(ATC(\",\",NAME)=0,WORD(NAME,-1),WORD(SUBSTR(NAME,1,(ATC(\",\",NAME)-1)),-1))"
                update.field4 = "MR"
                update.expr4 = "iif(word(Name,3)=\"Mrs\",WORD(NAME,1)+\" \"+WORD(NAME,2)+\" \"+WORD(NAME,3)+\".\",WORD(NAME,1))"
                update.field5 = "FIRST"
                update.expr5 = "IF(UT(WORD(NAME,3))<>\"MRs\",word(name,2),word(name,4))"

                'Prompt for confirmation before running the Operation.......
                dim rec_count as n
                rec_count = a5_get_records_in_query("calllist",a5_operation_filter)
                message_text = rec_count + " record(s) from 'calllist' will be updated."+crlf(2)+ "OK to proceed?"
                operation_result=ui_msg_box("Update Operation",message_text,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
                If operation_result <> ui_ok_selected then
                end
                end if



                a_tbl.update()
                a_tbl.close()
                'Display a dialog box showing the results of the Operation
                '(If last parameter is blank, button to show result is not displayed).
                a5_update_op_result(a_records_processed, a_records_violated,"calllist")

                'If the Operation is run from within a Form or Browse, then refresh the window
                if is_object(topparent.this) then
                if topparent.Class() = "form" .or. topparent.class() = "browse" then
                topparent.Refresh_layout()
                end if
                end if

                Comment


                  #9
                  Re: Operation to script

                  Originally posted by lkatz1 View Post
                  Still don't understand if the script has a dbase name in the script ex :a_tbl = table.open("check")
                  how will it work on other dbase

                  make the table name a variable and pass it into the script.

                  Code:
                  dim mytable as C
                  a_tbl = table.open(mytable)
                  In the oter database, just define mytable as the name of the table you want, then you're good to go.

                  Tom

                  Comment


                    #10
                    Re: Operation to script

                    does this replace any lines?
                    what means define ? were? rename?

                    Comment


                      #11
                      Re: Operation to script

                      This script looks like it was derived from an operation converted to x-basic. Is this operation specific to this table, or are you attempting to massage a bunch of tables that have a similar issue?

                      If so, then we need to look at common field names and create an x-basic update to fix the offending fields. We can take care of the table names later, but I think we need to know what the real problem is.

                      Tom

                      Comment


                        #12
                        Re: Operation to script

                        yes
                        this operation is to be used for tables with simular fields on same computer but different hard drive c: d:e: f: g:

                        Comment


                          #13
                          Re: Operation to script

                          if the tables are named the same, and in the same name directory, with the same field names, then if you include this script from one of the database libraries into the other databases, a non-qualified table name will suffice.

                          this would be a+tbl = table.open("mytable")

                          "Mytable" is the name of the table within the specific database on whichever drive that database exists. leaving the qualifier "c:\folder\" off of the table name in the "open" will insure that the table within the database on each drive is opened.

                          Tom

                          Comment


                            #14
                            Re: Operation to script

                            The names are not the same but the fields are the same?

                            Comment


                              #15
                              Re: Operation to script

                              Are the fields NAMED the same??

                              Comment

                              Working...
                              X