Alpha DevCon 2018
Results 1 to 6 of 6

Thread: Dual calculated fields newbie question

  1. #1
    Member
    Real Name
    Paul Hunter
    Join Date
    Aug 2014
    Posts
    10

    Default Dual calculated fields newbie question

    I don't see this as possible since an input field would also need to be a calculation field, but being non-code person, I have to ask.

    I have a field called "Site_ElevationMeters" and another field called "Site_ElevationFeet" in a table called "Sites".

    Sometimes the data comes in feet and others times it comes in meters.

    Being stupid on code and program being newbie, is there a way that when you input data in the meters field it can automatically calculate the meters to feet and put that value in the feet field and visa versa? Basically upon depart of either field maybe?


    My meter to feet calculation would be (feet = meters * 3.28084) and feet to meters would be (meters = feet*0.3048)

    Thank you for reading and any detailed help you may provide!

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,946

    Default Re: Dual calculated fields newbie question

    I would suggest coding the table field rules, field event, onwrotefield.

    The code for the Site_ElevationFeet
    tbl = table.current()
    tbl.Site_ElevationMeters = tbl.Site_ElevationFeet*0.3048

    and Site_ElevationMeters
    tbl = table.current()
    tbl.Site_ElevationFeet = tbl.Site_ElevationMeters*3.28084
    Last edited by Stan Mathews; 06-12-2018 at 04:18 PM.
    There can be only one.

  3. #3
    Member
    Real Name
    Paul Hunter
    Join Date
    Aug 2014
    Posts
    10

    Default Re: Dual calculated fields newbie question

    Thank you Stan!

    Works great!

    Thank you for providing clear instructions and code to make this happen!

    I do have a stupid question on when you use the runtime after development, do the popup error messages or confirmations still say Alpha Anywhere in the top blue bar of popup message and if it does, can that be changed somewhere? I am just doing a desktop application. On delete record, I did a display message followed with a delete record code to bypass the Alpha message, but then there are more builtin messages Alpha has many like for cancel changes, etc.....

    It only took me over 4 years to decide to finally try the software, so its all new to me, but I'm starting to like it more than when I first launched it.

    Thank you again!

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,946

    Default Re: Dual calculated fields newbie question

    I'm not aware of any changes to the display of error messages and confirmations nor any way to customize them.
    There can be only one.

  5. #5
    Member
    Real Name
    Paul Hunter
    Join Date
    Aug 2014
    Posts
    10

    Default Re: Dual calculated fields newbie question

    OK, thank you for your help!

  6. #6
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,959

    Default Re: Dual calculated fields newbie question

    I posted in another question that you might consider freezing the screen and re activating it. Might get rid of the visible error message, you will need to test it. Another option is to "Run Silently" as an operation.

    Error messagesare there for a reason, proceed at you peril!
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. Newbie question: Look Up Table from multiple tables and fields
    By frumple in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 09-04-2009, 09:57 PM
  2. Question about arguments and calculated fields
    By Tommy Thompson in forum Application Server Version 9 - Web/Browser Applications
    Replies: 5
    Last Post: 08-12-2008, 12:32 PM
  3. newbie question: max fields in a table
    By dlazenby in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 07-02-2008, 10:07 AM
  4. Question about calculated fields
    By Mike Parks in forum Application Server Version 8
    Replies: 5
    Last Post: 10-10-2007, 02:31 AM
  5. calculated fields question
    By ken doucet in forum Alpha Five Version 7
    Replies: 28
    Last Post: 03-09-2006, 07:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •