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

Weird problem

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

    Weird problem

    First, I don't really know how to describe this without going into great detail so forgive me if I give too much info, but here goes:

    I have a table that I want to be able look up info in. It is a log scale table and I need the user to enter the width and length in fields in an embedded browse on a form. For example, for the Scribner scale, I would like to use the width (diameter) is what would be in excel terms the row and the length is the column. But since I can't use just numbers in the column(field)name, I started it with an "S". For example, field S1 is one foot in length, fieldname S20 is twenty feet in length.

    I can easily use the width to lookup the appropriate row but need to somehow use the length number to determine which fieldname or column to select.

    In excel, I would use HLookup or Vlookup to find this intersection of the correct column and row, but I don't know how to convert a number to a fieldname to find the column.

    Thanks in advance,

    Robin

    #2
    RE: Weird problem

    Robin,

    I won't pretend to know anything about scaling logs, but would it not be easier to simply calculate the result?

    Scribner:
    V = (0.0494*Dia*Dia*Length)-(0.124*Dia*Length)-(0.269* Length)

    Where 10 is Dia and 12 feet is length:

    V =(0.0494*10*10*12)-(0.124*10*12)-(0.269*12)
    ?v
    = 41.172

    0r:

    V =(0.79*Dia^2-2*Dia-4)*Dia/16

    V =(0.79*10^2-2*10-4)*12/16

    ?v
    = 41.25

    The formulas give sligtly different results and I just quick pulled them off the web as examples. I would find out what your using and use that formula.

    Anyway,
    you could have two variables Dia and length. Enter values in these variables, run a script to plug the values in the formula and calculate the result. You could also have list boxes for the values that would populate the correct variables upon selction of list values.


    Phil

    Comment


      #3
      RE: Weird problem

      Robin,

      If the field names follow a consistent pattern, such as
      S10
      S11
      S12
      S13

      and if the numeric portion of the field name corresponds to a particular length, you could get the field value using the Eval() function.

      Here's what I mean.

      In Alpha Five once the record pointer is moved to the right row, the value stored in any field is available to you using just the field name. You don't have to do a lookup or use a function like the ones you describe for Excel. The entire record is in a buffer, and its elements are accessible using the field names.

      So, if your script knew the desired field name it could retrieve the field value like this:

      tbl = table.current()
      vCurrValue = tbl.S10

      In this example the variable vCurrValue would receive the value in the S10 field from whatever row is currently selected in the table referenced by the poiner, tbl.

      In your case, the script knows that each field name begins with an "S" and your user is supplying an "length" value that will vary. How to retrieve the field value from the current row of the table?

      Well, the trick would be to build a string representing the field name, and let the Eval() function process it for you.

      Here's an example from the Interactive Window, using the attached table. If you save the attachment to disk do so using an empty folder.

      Code:
      tbl = table.open("Scribner")
      tbl.index_primary_put("ByDiam") 'set index needed by fetch_find
      tbl.fetch_find(12) 'fetch the desired row
      
      ?tbl.S12   'this line just shows you the field value
      = 144.000000
      
      ?eval("tbl.S" + "12")  'this line show how to use eval()
      = 144.000000
      
      tbl.close()
      -- tom

      Comment


        #4
        RE: Weird problem

        Robin,

        I have a question about your approach which has spreadsheet overtones (ominious music here).

        If your length values are fixed and small, that is, values from 1-20 with new values unlikely you can work as you have it set up. However, if you ever have to enter a new length you will need to edit the table definition.

        On the other hand, if you had a table with a record for each Width-Length combination adding new values would only involve adding records. The lookup would still be simple and (if properly indexed) fast.

        Bill
        Bill Hanigsberg

        Comment


          #5
          RE: Weird problem

          Phil,

          The only way to get the correct standardized info is from a table. I wish there was a consistent formula that could be worked out for this. :)

          Comment


            #6
            RE: Weird problem

            Hi Tom,

            You have come to my rescue again...

            So would I use a variable tied to the onchange event for the "length" field on the form to populate the numeric part of the eval()? Would there be a better way to do this?

            The table shows 40 possible lengths and 17 possible widths, which (although I hadn't even thought of this before) if I put this into separate records would mean more than 600 records.

            Just to give some addl info, this is something that is going to need to be called up often and the options of lengths and widths shouldn't need to change.

            I appreciate all of your help,

            Robin

            Comment


              #7
              RE: Weird problem

              Robin,

              You should experiment with different ideas for the interface the user will see. It certainly is possible to create a variable in the properties of your form, and then drop that variable on the form. You could then either use an event like OnDepart or OnChange I suppose , or maybe a separate button altogther, as the hook upon which to run the script and calculate the field value.

              -- tom

              Comment


                #8
                RE: Weird problem

                If you don't want to use a formula, you could create a table with 18+ fields. Then enter 20 records which gives you your 20X17 spreadsheet like matrix. The first field would the length; the other 17 would be the width/value: Field names might be W1, W2, W3...with the value you want to lookup. etc. etc.
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment

                Working...
                X