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

2 really great things in A5. And my IMPORT Question

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

    2 really great things in A5. And my IMPORT Question

    1. When you set a field as "Value of field must be unique" A5 ignores the fact that a field is blank and not count against a unique value. ie you can have many empties on a unique field.
    This was one of the short comings of my old application platform. It counted every field as unique even when it was blank.
    Prior to that I used BTrieve and it allowed you to (Yes or No) the count for null value.

    2. Ok, here is the other:
    I always had a real straight forward import routine...simply:
    file-import-import file-(assumes into the active table)-fields to import. Bingo, done.
    Gives notice if duplicate attempted on a field with unique field property that you could silence or not.
    ----------
    I found essentially the same thing in A5:) after looking around for all the import methods it had. This was the last one to be found:
    Code:
     
    FUNCTION QuikImport AS C (val_to_import as C)
    [B]data = <<%a%[/B]
    [B]R5T0100[/B]
    [B]R5T0101[/B]
    [B]R5T0102[/B]
    [B]R5T0103[/B]
    [B]R5T0004[/B]
    [B]R5T0105[/B]
    [B]%a%[/B]
    '----------------- Here's the guts:
    t = table.open("TARGET_TBL")
    t.populate_from_string("TABLE_FLD", crlf(), data)
    t.close()   
    '----------------- Really simple and FAST!
    END FUNCTION
    (This could either be a Function or just a XB script.) And you can have whole groups of fields as long as they were on the same line and separated by (,).
    Anyway, i would like to know HOW I can populate the
    data = <<%a%
    .....
    %a%

    data items from a calculation result on the fly so to speak.
    ie. how to populate the data items straight from a calculation. Then call the function.
    -------------
    Right now I write them to an ascii file then import them in a much longer routine that creates temp tables and does checks that I do not need in this operation.
    I was thinking of having the function called for every calc result and then t.close() after all the imports were done....as many as 150 at a time.
    Then I'd skip the
    data = <<%a%
    .....
    %a%
    and just send the result as a Function(vals_to_import as C) 150 times, then close the table.
    One of the things I would like to do is report how many records were added at the end of the operation if anyone has an idea on that also?

    The key item is:
    <TBL>.POPULATE_FROM_STRING( Record_Format as C, Record_Separator as C, Data as C )
    Argument ********* Description
    Record_Format: A comma delimited list of field names.
    Record_Separator: The character or expression that separates records in the Data field.
    Data: Data to place into the table.
    First Love

    #2
    Re: 2 really great things in A5. And my IMPORT Question

    Hi Tom,

    One of the things I would like to do is report how many records were added at the end of the operation if anyone has an idea on that also?
    I would suggest you have a separate Info table to store that data, along with the date and type of operation.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: 2 really great things in A5. And my IMPORT Question

      Originally posted by Keith Hubert View Post
      Hi Tom,

      I would suggest you have a separate Info table to store that data, along with the date and type of operation.
      Thanks,
      This table can be thought of as a "inventory of consumables". We fill it with say "unique numbered stickers" then they are automatically issued sequentially into new records in a main table as they are created/completed.
      Once that happens, they are flagged in the inventory as "Used", and what main data record# received that "sticker" and who the user was.
      This inventory of "Used" is periodically purged after about 3 months since the main data record now stores it....indefinitely.
      Then more inventory is added, and so on. So it grows to maybe 200 recs. then dwindles to 25 or so, then refilled.
      The refills are not issued until a report from the main data table accounts for all the issued stickers in sequence, usually for each 10 day period.
      From time to time the user wants a quick account of the still available stickers, so I just give a record count of stickers that are not flagged from a button on push.
      Anyway, my main problem is the best way to add those sticker numbers.
      The user puts in the first# of the pack on a screen form, then the last#.
      The application figures how many bet. those numbers, and inserts them into the inventory file at one rec. for each sticker#.
      First Love

      Comment


        #4
        Re: 2 really great things in A5. And my IMPORT Question

        Anyway, my main problem is the best way to add those sticker numbers.
        The user puts in the first# of the pack on a screen form, then the last#.
        The application figures how many bet. those numbers, and inserts them into the inventory file at one rec. for each sticker#.
        Code:
        tbl = table.open("tabletoholdstickernumbers")
        for i = first# to last#
             tbl.enter_begin()
             tbl.somefieldholdingthestickernumber = i
             tbl.enter_end(.T.)
        next i 
        tbl.close()
        There can be only one.

        Comment


          #5
          Re: 2 really great things in A5. And my IMPORT Question

          Thanks Stan,
          That did it!
          I had to add a few more validations to the script to prevent duplications, it is very fast!
          Removed a bunch of code also.

          One last problem:
          In User Input data entry field I have:
          Properties->format->UPPERCASE
          So, ONDEPART it does show UPPERCASE even when entered as lowercase.
          I assumed that the conversion was actual and not just in appearance.
          Anyway, when I insert the user's input into the table it reverts to lower case.
          Is there a way to make the vValue be truly UPPERCASE and insert into the table that way?

          Or must I do this thru the table's Field Rules?
          I already have the Field Rules->Transformation->UPPER set but no effect.
          Or better to do it thru the Xb code before inserting it into the table Fld?
          Last edited by SMARTII; 11-27-2009, 06:53 PM.
          First Love

          Comment


            #6
            Re: 2 really great things in A5. And my IMPORT Question

            Hi Tom,

            Or better to do it thru the Xb code before inserting it into the table Fld?
            Yes, with the UPPER() function.
            Regards
            Keith Hubert
            Alpha Guild Member
            London.
            KHDB Management Systems
            Skype = keith.hubert


            For your day-to-day Needs, you Need an Alpha Database!

            Comment


              #7
              Re: 2 really great things in A5. And my IMPORT Question

              Thanks,
              Upper() it is.
              Originally posted by Keith Hubert View Post
              Hi Tom,

              Yes, with the UPPER() function.
              First Love

              Comment

              Working...
              X