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

new to xbasic, asking for help

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

    new to xbasic, asking for help

    Hello,

    I�m new to xbasic and would like some help. To get familiar with xbasic, I�m trying to copy some tables from my Alpha Four directory to my Alpha Five directory, update the indexes, and be able to view all records using Alpha Five. We�re still using Alpha Four for data entry for these tables. But I�d like to be able to copy the data over for aid in developing my forms & reports.

    Here�s what I have so far. I�ve added the first 8 lines of text below to the xbasic for a button to open the form for a set that list records for the tables. Deltik.dbf is the parent and dellin.dbf is the child in the set. The records for the parent (deltik) are being copied and I can view all those records with A5, however, I am not able to view the related child records from the set (dellin). What could I do to get that to happen?

    file_copy("h:a4v6deltik.dbf", "c:program filesa5v4deltik.dbf")
    file_copy("h:a4v6dellin.dbf", "c:program filesa5v4dellin.dbf")

    table.open("c:program filesa5v4deltik.dbf")
    tbl=table.current()
    tbl.update_production_index()

    table.open("c:program filesa5v4dellin.dbf")
    tbl=table.current()
    tbl.update_production_index()

    DIM ax_choice as C
    DIM ax_response as N
    DIM ax_dialog as P


    ON ERROR GOTO ax_error_trap
    DIM ax_error_trap_desc as C
    DIM ax_error_trap_offset as C
    DIM ax_error_trap_msg as C
    DIM ax_error_trap_response as N

    ax_error_trap_desc = "Action Script"
    ax_error_trap_offset = "0"
    ax_error_trap_desc = "Inline Xbasic"
    ax_error_trap_offset = "1"
    if is_object("Delivery") then
    Delivery.show()
    Delivery.activate()
    else
    :Form.view("Delivery")
    end if


    END
    ax_error_trap:
    ax_error_trap_msg = "Trapped error in action command: [" + ax_error_trap_offset + "] " + chr(13) + chr(13) + "Command: " + ax_error_trap_desc + chr(13) + "Error: " + error_text_get()
    ax_error_trap_response = ui_msg_box("Action Program Error", ax_error_trap_msg, 2)
    IF ax_error_trap_response = 4 THEN ''Retry
    RESUME 0
    ELSEIF ax_error_trap_response = 5 THEN ''Ignore
    RESUME NEXT
    ELSE ''Abort
    END
    END IF
    ''****
    ''**** End

    THANK YOU,
    MIKE
    Thank you,
    Mike Konoff

    #2
    RE: new to xbasic, asking for help

    first, i would close the tables before i opened the form, since the form will open the tables, thus having two copies of each open.

    second - have you defined a set in alpha5 for the parent and child, and if so, is the form based on that set?

    if so, should display
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      RE: new to xbasic, asking for help

      PS: are you putting your application in the same folder as Alpha? if so - DON'T!! it will be nightmare trying to distinguish your application files from alpha files, later.
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      [email protected]

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


        #4
        RE: new to xbasic, asking for help

        Like Martin said, create a subfolder in your Alpha folder to hold your data files. Then copy your data files (including the memo files) from A4 to the new folder. Next, create a database in A5 and add your tables (which were called databases in A4)to the new database using A5's control panel. Save your database in the new folder. Now open your new database. Go to the control panel, tables tab, and right click on the table. Choose the default form or default browse and you should be able to view your records.

        Comment


          #5
          RE: new to xbasic, asking for help

          Have defined both the set and form. Both work fine. If I go in and update the indexes for the set after manually copying the tables from the A4 directory I "can" view and manipulate all records as aniticipated.

          The thing is that for the set in question, we still enter the data into our system using Alpha Four. I would like to arrange the button in Alpha Five so that each time I press it to load the set form, the parent and child files are copied to the A5 directory, the indexes are updated, and I can see the most recent files in A5 each time I go in there. I don't want to have to manually copy the tables over and manually update the indexes.

          Presently, the xbasic for the button I previously will copy and update the parent index, not the child index.
          Thank you,
          Mike Konoff

          Comment


            #6
            RE: new to xbasic, asking for help

            Hi mike,
            I'm not any better than you at xbasic but for the dbf's to work in A5 you have to copy both the dbf and dbt files over (as Ohlen said in his response).

            Russ

            Comment


              #7
              RE: new to xbasic, asking for help

              here is a script that will update the production indexes of all db's in your application.

              are you getting the records with an "append operation" or are you just copying them over with explorer? if so, are they immediately readable by A5V4? if so, then the following script should take care of all indexing problems.


              dim files as p
              dim tbl as p
              dim table_name as c
              dim location as c

              statusbar.clear()
              statusbar.set_text("Updating All Production Indexes")
              statusbar.disable()
              hourglass_cursor(.T.)
              on error goto noproblem
              files = filefind.first(A_DB_CURRENT_PATH+"*.dbf")
              WHILE .not. files.eof()
              table_name = files.name()
              tbl=table.open(table_name)
              tbl.update_production_index()
              tbl.close()
              files.next()
              END WHILE
              statusbar.enable()
              statusbar.clear()

              noproblem:
              resume next
              Cole Custom Programming - Terrell, Texas
              972 524 8714
              [email protected]

              ____________________
              "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

              Comment


                #8
                RE: new to xbasic, asking for help

                Mike,

                Alpha may be getting confused about your primary table. According to my documentation, opening a table with table.open does not necessarily make the table the primary table, so you might want to try:

                dim tbl as p 'set up tbl as table pointer
                tbl=table.open("first file name") 'assign pointer to file
                tbl.update_production_index()
                tbl.close()

                tbl=table.open("next file name") 'reassign pointer to next file
                tbl.update_production_index()
                tbl.close()
                and so on
                then open your form.

                Pat
                Pat Bremkamp
                MindKicks Consulting

                Comment


                  #9
                  RE: new to xbasic, asking for help

                  Hi All,

                  I have been trying to do what I wanted using the xbasic as per some listings in the reference manual...no luck. I did a search of these boards and found a post by Dr. Wayne that contained some xbasic. After going over that I tried some xbasic style that he had listed in there.

                  Pat...it's the same as what you have in your suggestion...and it now works...like a charm!

                  Thank you all for your help and suggestions.
                  :)
                  Mike
                  Thank you,
                  Mike Konoff

                  Comment

                  Working...
                  X