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

Object name with onpush indicator

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

    #16
    Re: Object name with onpush indicator

    Seems to me to work for 1970. Not all of the years are handled in the script.

    What do you see not working?
    There can be only one.

    Comment


      #17
      Re: Object name with onpush indicator

      I was focusing on trying to make it work with a range of elections before expanding the remaining years. The focus was on getting the conditional object labeled Senate Terms 1976 - 2026 work first. If you were checking the range from 1904 to 1974 then click on the button between the group of years and "Serve First". Right below the button with the down green arrow.

      U.S. Senators run for election once every 6 years unless there is a special election. If a Senator is elected in 1976 there won't be an election in 1978 or 1980. Next election would be 1982.

      I am trying to have "S" enter for years that a Senator is elected. For years that they are not elected but serving enter a "C".

      1976 -- S
      1978 -- C
      1980 -- C
      1982 -- S
      When the button is pushed for 1976 it should check to see if the Senator was elected in 1974 or serving. If elected a "C" would be enter. If serving in 1974 it would check to see if was serving in 1972 (Enter "S") if elected in 1972 (Enter "C"). Pattern is 2 election (even) years between years Senators are elected.

      The range you reviewed has a problem with this issue. It will not enter any data for the year after an election with "S" entered.

      1970 -- S
      1972 --
      1974 -- S
      1976 --
      1978 -- S
      It needs to be
      1970 -- S
      1972 -- C
      1974 -- C
      1976 -- S
      1978 -- C
      It does not seem to correctly interpret the expression after the variable Senate_E1. Or I have it written wrong.

      I also attempted writing it different starting with Senate 1978.

      Comment


        #18
        Re: Object name with onpush indicator

        I think I see now.

        Define a global variable for the form pushed_btn. Set it to any year you want. I used
        pushed_btn = "1904"

        Add an inline xbasic element to each button as the first action,

        dim global pushed_btn as C
        pushed_btn = right(this.Name(),4)

        The elect_senate script is then

        Code:
        dim global pushed_btn as C
        Dim Senate_Status as C
        Dim Senate_E1 as C
        Dim Senate_E2 as C
        Dim Senate_E3 as C
        Dim Tbl_Senate as C
        Tbl_Senate ="Senate->S"
        Senate_Status =""
        Senate_Year = val(pushed_btn)
        		Senate_E1 =Tbl_Senate +str(Senate_Year,4)
        		Senate_E2 =Tbl_Senate +str(Senate_Year-2,4)
        		Senate_E3 =Tbl_Senate +str(Senate_Year-4,4)
        		select
        		case isblank(Senate_E1)
        			select
        			case isblank(Senate_E2)
        				Senate_Status = "S"
        			case isnotblank(Senate_E2)
        				select
        				case Senate_E3 ="S"
        					Senate_Status = "C"
        				case Senate_E3 ="C"
        					Senate_Status = "S"
        			end select
        			case else
        				Senate_Status =""
        		end select
        		case isnotblank(Senate_E1)
        			Senate_Status =""
        		case else
        			Senate_Status =""
        	end select
        	eval("parentform:Senate_"+pushed_btn+".value") = Senate_Status
        There can be only one.

        Comment


          #19
          Re: Object name with onpush indicator

          I probably don't have the logic right but there's a problem in your script with the isblank() and isnotblank() statements. You're inadvertently testing whether the variables Senate_E1, etc are blank, not the table fields you intend.

          I changed from the global variable scenario I suggested and created a udf. The udf is the onpush code for each button (I changed 1976 to present). The udf has one parameter, the year portion of the button name. I change the "blank" tests to alltrim(eval(variable_name)). Eval() returns the field value. Also changed the logic a bit as well.

          Give it a try.

          Congress.zip
          Last edited by Stan Mathews; 12-23-2014, 12:57 PM.
          There can be only one.

          Comment


            #20
            Re: Object name with onpush indicator

            Thanks Stan, I tweaked the case part when Senate_E2 >"". It was nearly making it work except it would leave the election year blank after 2 non elected years showing with a "C". The result was S - C - C - Blank - S - C - C - Blank. After tweaking it is now S - C - C - S - C - C.

            Replaced that section with:

            Code:
            case alltrim(eval(Senate_E2))= "S"  (Section starting with -- case alltrim(eval(Senate_E2))> "")
            	Senate_Status = "C"	
            case alltrim(eval(Senate_E2))= "C"
            	select
            		case alltrim(eval(Senate_E3)) ="S"
            			Senate_Status = "C"
            		case alltrim(eval(Senate_E3)) ="C"
            			Senate_Status = "S"	
            	end select

            Comment

            Working...
            X