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

Trying to COPY a custom Alpha/5 Basic Application

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

    Trying to COPY a custom Alpha/5 Basic Application

    So,

    Here's the app I'm trying to copy, remotely, to my other PC:

    -----------------------------------------------------------------------------

    'Date Created: 29-Jun-2023 11:04:35 AM
    'Last Updated: 16-Sep-2023 08:29:58 AM
    'Created By : larry
    'Updated By : larry

    dim t as p
    dim m as p

    t = table.open("inswrk")
    m = table.open("county")
    m.query_create("N",".t.","county")

    dim count as n = t.records_get() 'get tne number of records in the transaction table
    dim i as n

    for i = 1 to count 'loop over all of the records in the transaction table

    dim county as c = t.county
    m.fetch_find(county) 'find the matching rerd in the county table

    dim sequence as n = m.sequence 'get the current sequence value
    dim nextsequence as n = sequence + 1 'increment sequence by one

    m.change_begin() 'update the sequence in the county table
    m.sequence = nextsequence
    m.change_end(.t.)

    t.change_begin() 'update the sequence in the trnsaction table
    t.sequence = nextsequence
    t.change_end(.t.)

    t.fetch_next()

    next i

    ui_msg_box("","done")

    t.close()
    m.close()

    ​---------------------------------------------------------------

    It only has 2 files. After I copied the app, I logged onto the REMOTE PC to verify both of the files were there, and that the field names were exactly the same. They were. When I try to run the app, I get an error. So, I don't understand. When I came back to my master PC, it all works fine.

    Does anyone have any ideas ???

    Thanks,

    Lar

    #2
    So here's the error message I'm getting:

    Dim county as c = t.county
    Property not found
    t.county sub element not found

    Does anyone understand this ?

    Lar

    Comment


      #3
      So, what does the error mean?

      "t.county Subelent not found" ???

      I checked the file and the field/subelement t.county is there.

      Lar

      Comment


        #4
        Hi Larry,
        The error means the field county is not found in the inswrk table as a character field. Run this in the IW and assure the dictionary has the field registered as a character field.
        dim vL as C=table.external_field_name_get("inswrk","n,t")
        msgbox(vL)​.

        Might try this code instead of yours also.
        Code:
        'DIM VARIABLES
        dim county as c
        dim sequence as n
        dim nextsequence as n
        dim vnrecs as N
        dim cycle as N=0
        dim t as p
        dim m as p
        
        'OPEN WAIT DIALOG
        DIM GLOBAL pDlg1 as {waitdialog}
        pDlg1.Set_Title("Please Wait")
        pDlg1.Create(1,"Percent")
        
        
        'OPEN TABLES
        t = table.open("inswrk")
        m = table.open("county")
        xt=t.order("county",".t.")
        vnrecs=xt.records_get()
        
        'LOOP THROUGH INSWRK TABLE
        t.fetch_first()
        while .not. t.fetch_eof()
        county=t.county
        
        'INCREMENT THE WAIT DIALOG
        cycle=cycle+1
        pDlg1.Set_Message(county)
        pDlg1.Set_Bottom_Message(str(cycle)+" of "+(""+vnrecs))
        pDlg1.Set_Percent(Var->cycle,Var->vnrecs)
        
        'FIND THE MATCHING RERD IN THE COUNTY TABLE
        m.fetch_find(county)
        
        'GET THE CURRENT SEQUENCE VALUE
        sequence= m.sequence
        
        'INCREMENT SEQUENCE BY ONE
        nextsequence=sequence + 1
        
        'UPDATE THE SEQUENCE IN THE COUNTY TABLE
        m.change_begin()
        m.sequence = nextsequence
        m.change_end(.t.)
        
        'UPDATE THE SEQUENCE IN THE TRNSACTION TABLE
        t.change_begin()
        t.sequence = nextsequence
        t.change_end(.t.)
        
        'NEXT RECORD
        t.fetch_next()
        end while
        
        'END SCRIPT
        t.close()
        m.close()
        pDlg1.close()
        msgbox("Update complete")
        
        END​
        Last edited by Mike Wilson; 09-16-2023, 04:39 PM.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Mike Thank You. I'll try right now and let you know how it works.

          Lar

          Comment


            #6
            Mike,

            Copied the script down to my remote pc, installed it and tried to run. Got the following error:

            Script: Test11 Line 20
            vnrecs = xt.records_get()
            not found
            xt.records_get method not found.

            ???

            Lar

            Comment


              #7
              Mike,

              The script I posted runs but, does not change the SEQUENCE field. If you had any clue WHY, I'd be very appreciative.

              Lar

              Comment


                #8
                Mike, I need to compliment you on your code writing discipline. Your code is so easy to read and 5 years from now, one would have no trouble at all reading through your code.
                Alpha 5 Version 11
                AA Build 2999, Build 4269, Current Build
                DBF's and MySql
                Desktop, Web on the Desktop and WEB

                Ron Anusiewicz

                Comment


                  #9
                  I'm obviously missing summat here.
                  Why not just zip the app, copy to the new machine and unzip it?
                  See our Hybrid Option here;
                  https://hybridapps.example-software.com/


                  Apologies to anyone I haven't managed to upset yet.
                  You are held in a queue and I will get to you soon.

                  Comment


                    #10
                    Hi Ron,
                    Thank you. It's been all learned from others, including you.

                    Ted,
                    I believe Larry is confused in his statement regarding copying an app. I believe he did copy the app over and now trying to operate the app on the other machine and running this code and having issues with this update script. I think.

                    Larry,
                    Run this code in the Interactive Window that gather the same information from the table with two different methods. If you get any errors then you have much deeper issues. Only way I could help is for you to zip up the two tables or the whole application and post them and have them to troubleshoot your issues.

                    Code:
                    'CODE 1
                    msgbox(""+tablecount("inswrk",".t."))
                    
                    'CODE 2
                    dim t as p
                    dim vnrecs as N
                    t=table.open("inswrk")
                    vnrecs=t.records_get()
                    t.close()
                    msgbox(""+vnrecs))
                    Mike W
                    __________________________
                    "I rebel in at least small things to express to the world that I have not completely surrendered"

                    Comment


                      #11
                      Thanks Mike, that makes sense.
                      I wouldn't do it that way though.
                      Easier with an Update operation?

                      Or, run the update script then port the app over?
                      See our Hybrid Option here;
                      https://hybridapps.example-software.com/


                      Apologies to anyone I haven't managed to upset yet.
                      You are held in a queue and I will get to you soon.

                      Comment


                        #12
                        So Ted/Ron, here's the app. The COUNTY portion is working but, the INSWRK9 is not. I'll keep futsing around.

                        --------------------------------

                        'Date Created: 16-Sep-2023 12:31:13 PM
                        'Last Updated: 17-Sep-2023 01:33:08 PM
                        'Created By : larry
                        'Updated By : larry
                        dim t as p
                        dim m as p

                        t = table.open("inswrk9")
                        m = table.open("county")
                        m.query_create("N",".t.","county")

                        dim count as n = t.records_get() 'get tne number of records in the transaction table
                        dim i as n

                        for i = 1 to count 'loop over all of the records in the transaction table

                        dim county as c = t.county
                        m.fetch_find(county) 'find the matching rerd in the county table

                        dim sequence as n = m.sequence 'get the current sequence value
                        dim nextsequence as n = sequence + 1 'increment sequence by one

                        m.change_begin() 'update the sequence in the county table
                        m.sequence = nextsequence
                        m.seq = nextsequence
                        m.change_end(.t.)

                        t.change_begin() 'update the sequence in the trnsaction table
                        t.sequence = nextsequence
                        t.change_end(.t.)

                        t.fetch_next()

                        next i

                        ui_msg_box("","done")

                        t.close()
                        m.close()​

                        --------------------------------------------------

                        Lar

                        Comment


                          #13
                          In the INSWRK9 file, I am trying to get the field: SEQ to update, unsuccessfully

                          Comment


                            #14
                            I would insert the debug(1) command in the beginning of the script. Then one can step through the code verifying each line, values and variables.
                            Alpha 5 Version 11
                            AA Build 2999, Build 4269, Current Build
                            DBF's and MySql
                            Desktop, Web on the Desktop and WEB

                            Ron Anusiewicz

                            Comment


                              #15
                              Finally got the script to work with all files and appropriate fields in sync.

                              Thank you...

                              Lar

                              Comment

                              Working...
                              X