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

current field

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

    current field

    Am trying to determine which field currently has focus on a form in order to run a script. Have 2 fields, field1 and field2. If field1 has focus, then do this. If field2 has focus, do that. In testing, I put this in the on arrive event of field1.
    Code:
    name = :order_details.Active()
    I get the "argument is incorrect data type. The "A_CURRENT_FIELD.NAME_GET()", evidently, can only be used in writing Field Rule scripts. Seems to be unrecognized in an xBasic script.
    Will welcome any help.
    Ernie

    #2
    Re: current field

    Ernie:

    if you are trying to get the "name" of the object name of the field that has focus to place in a variable
    Code:
    name=formname.fieldname.object.name
    This gives you the name of the field as it is described in the properties -object

    if you are trying to get the name of the field as it shows in the structure of the table

    Code:
     name=formname.fieldname.entry.name
    This will give you the name of the field along with the table ie table->fieldname


    I hope I am reading your post right.

    if your script should run when the field has focus (at the time it gets focus) then that is what the OnArrive event is for.

    I am somewhat confused as to what you are trying to accomplish.




    Tom Baker
    Last edited by Tbaker; 07-12-2008, 12:25 PM. Reason: added

    Comment


      #3
      Re: current field

      Tom,
      Thanks for the quick response. Here's what I'm trying to do. Have 2 date fields that I'm adding a feature for incrementing the date by one. Have this in the OnKey event of the form:
      Code:
      if a_user.key.value = "+" then
          parentform:plusbtn.Push()
      else if a_user.key.value = "-"
      	parentform:minusbtn.Push()   
      end if
      Had this code because I only had one date field on the form. Now that I've added another date field, I add two more buttons, plusbtn2 & minusbtn2. So if the user is in date field 1, do the above code. If in date field 2, same code except I'll change the button obj. names. (IF...THEN..ELSE..).
      Hope this clears it up.
      Ernie

      Comment


        #4
        Re: current field

        V9-3163
        here is an example to try, although I didn't use your names, but should be obvious what to replace
        Code:
        if a_user.key.value = "+" 
          if a_user.key.event="down"
            if parentform.active()="xxx"
                 parentform:plusbtN.Push()
            elseif parentform.active()="yyy"
                 parentform:plusbtM.Push()
            end if
          end if 
        end if
        Last edited by martinwcole; 07-12-2008, 01:10 PM.
        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


          #5
          Re: current field

          Martin,
          I am assuming the "xxx" and "yyy" are my field object names??? I tried that, but wanted to make sure that was the correct syntax by doing a debug thru the code. Kept getting the argument error, so the reason for my post. I will try what you've got there. Thanks.
          Ernie
          BTW, I have a son that lives just a little NE of Quinlan.

          Comment


            #6
            Re: current field

            Ernie

            Here is a zip file.

            formt31 shows a name field (does nothing) and two date fields.

            Go to date hired and then push plus sign it will increment the value by one - pushing the minus sign will decrease the value by 1.

            Go to date left - same thing

            Look at the onarrive event for those two fields

            The look at the forms onkey event.

            Tom Baker

            Comment


              #7
              Re: current field

              I know why you get the error - most likely - if they are in say a date field when the push the "+" key that may be it

              here is another example, with amended code, that worked when I enter "+" in a date field - note the a_user.key.handled=.t.

              Code:
              if a_user.key.value = "+" 
                if a_user.key.event="down"
                  if parentform.active()="datein"
                   a_user.key.handled=.t.
                   msgbox("","ok")
                   end 
                  end if
                end if 
              end if
              PS: when I was going to college used to live in Arbala and Sulphur Springs - had a lot of family over there - some had dairy farms (ugh - worst job in the world)
              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: current field

                Got it to work. Here's my final code.
                Code:
                if a_user.key.value = "+" then
                	if a_user.key.event = "down"
                		if parentform.Active() = "order_date"
                			parentform:order_date.text = dtoc(ctod(parentform:order_date.text)+1)
                		elseif parentform.Active() = "dt_paid"
                			parentform:dt_paid.text = dtoc(ctod(parentform:dt_paid.text)+1)
                		end if
                	end if		    
                elseif a_user.key.value = "-"
                	if a_user.key.event = "down"
                		if parentform.Active() = "order_date"
                			parentform:order_date.text = dtoc(ctod(parentform:order_date.text)-1)
                		elseif parentform.Active() = "dt_paid"
                			parentform:dt_paid.text = dtoc(ctod(parentform:dt_paid.text)-1)
                		end if
                	end if		    
                end if
                Tom, thanks for taking the time to create your little zip file for me. There's always more than one way to skin a cat. I looked all over the help files but never ran across your use of the ".object.name". Glad to learn another way of doing this.
                I just removed the buttons. Had put them there because I couldn't get my code to work just from the OnKey event. Martin's example made me realize I needed the "...event = "down" in there to make it work. Thanks, Martin.
                Really appreciate you guys taking the time to help out a struggling newbie.
                Ernie

                Comment


                  #9
                  Re: current field

                  [ATTACH]17979[/ATTACH]

                  Comment


                    #10
                    Re: current field

                    G,
                    Where's the code behind what it shows?
                    Ernie

                    Comment


                      #11
                      Re: current field

                      G,
                      Were you willing to send the code??
                      Alan

                      Comment


                        #12
                        Re: current field

                        I believe G Gabriel is/was located in the New Orleans area, so he may be out of the forum for a while. Hopefully all is well with him.

                        I also really liked his video on the hotkeys, and am wanting very badly to put something similar in my application.

                        If anyone has any good scripts or is currently using something similar and is willing to share, I would be appreciated.

                        I think in the past that onkeys could really slow down entry, but I don't know if that's still the case in V9.

                        Alan

                        Comment


                          #13
                          Re: current field

                          Alan,

                          Once upon a time G felt that others in the forum were taking credit for his solutions and ideas. G then stopped showing his code in examples he prepared for the message board. Maybe he'll have a change of heart, maybe not. -- tom

                          Comment


                            #14
                            Re: current field

                            That's too bad. I hope he has a change of heart.

                            I just want to use it to make my apps better. I would never tell anyone that it was mine. I would leave his name in the code, and forever know it was his.

                            I would even pay him something for it, if it looks like it would work as well as what the video shows. I've been programming for over 32 years, so I understand where he's coming from, but from a making my applications better, I sure could use it. It would save me time from reinventing the wheel.

                            Alan

                            Comment


                              #15
                              Re: current field

                              Alan:
                              Sorry for the late response, have been very busy lately. I will try and dig that zip file and send you the code. It is not necessary to credit it to me. Quite frankly I don't care if you credit it to Micky Mouse or even to that GIECO lizard.. in fact, I wish you do not credit it to me. Contrary to what Tom said, that has not been a point of contention but I do not wish to visit these issues here. And as to paying me for the code: thanks, no need for that. Donate the money to someone who needs it.

                              Comment

                              Working...
                              X