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

time calculation

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

    time calculation

    on fetch Code
    Code:
    'Date Created: 03-Apr-2009 02:17:32 PM
    'Last Updated: 22-Apr-2009 05:07:47 PM
    'Created By  : steven
    'Updated By  : Steven
    dim shared vTstarta as C
    dim shared vTstartb as C
    dim shared lviewed as C
    dim shared calla as T
    calla = time()
    lviewed = trim(convert_type(date(),"c"))
    vTstarta = convert_type(date(),"c")
    vTstartb = convert_type(time(),"c")
    On button push
    Code:
    'Date Created: 04-Apr-2009 12:44:50 AM
    'Last Updated: 22-Apr-2009 04:17:56 PM
    'Created By  : steven
    'Updated By  : Steven
    dim vTend as C
    dim ledit as C
    dim today as C
    dim callb as t
    dim calltime as c
    vTend = convert_type(time(),"c")
    today = convert_type(date(),"c")
    callb = time()
    calltime =  totime(toseconds(callb)-toseconds(calla),2,0)
    
    
    topparent.commit()
    dim ft1 as p
    ft1=topparent:free_text1_rtf.this
    ft2=topparent:free_text2_rtf.this
    lstnote=topparent:LSTNOTE1.this
    
    ft1.rtf.set_cursor(1)
    ft1.rtf.insert_text("Start: " + vTstarta + vTstartb + crlf())
    ft1.activate()
    xbasic_wait_for_idle()
    textlen=len(ft1.rtf.plain_text)
    ft1.rtf.set_cursor(textlen+1)
    ft1.rtf.insert_text(crlf())
    xbasic_wait_for_idle()
    ft1.textselect(1,-1)
    ft1.rtf.cut()
    
    lstnote1.show()
    lstnote1.activate()
    
    IF a5_eval_expression("=Var->lstedit<>date()") THEN 
    lstnote1.textselect(1,-1)
    lstnote1.rtf.delete()
    END IF
    lstnote1.rtf.set_cursor(1)
    lstnote1.rtf.paste()
    lstnote1.rtf.insert_text(vtend)
    lstnote.hide()
    
    xbasic_wait_for_idle()
    
    ft2.field.readonly=.f.
    ft2.activate()
    ft2.rtf.set_cursor(1)
    ft2.rtf.paste()
    ft2.rtf.insert_text("End: " + vTend + crlf()+ calltime + crlf())
    ft2.field.readonly=.t.
    topparent.commit()
    sys_send_keys("{F9}")
    And this is how it comes out
    Start: 04/22/200917:39:37
    xcv
    End: 17:39:55
    Call Time11:59
    Start: 04/22/200917:39:37
    dfdfvdv
    End: 17:39:40
    Call Time11:59

    I am trying to make a call timer to count how many minutes/hours are spent with the file open
    not sure how to correct this
    https://www.housingeducator.org
    k3srg

    #2
    Re: time calculation

    Steve, could you post a small app with this in it so it can be worked with?

    Comment


      #3
      Re: time calculation

      Hi Steve,

      I would suggest a separate table to record the date and times when each table was opened and closed, possibly you could add the users name too. That way you would have all the records in one place.
      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


        #4
        Re: time calculation

        Keith This is code you gave me that i have modified to my taste. I've got the the start time in the memo and the end time just trying to caculate the time between calla callb. which calla is var time() on fetch and callb is var on push of save notes button. I'm trying to get calltime in the rtf memo to display time spent "callb-calla" i either get 12:01 or if it goes past the next hour such as 12:45-13:15 gives me a negative #. Here is my database app, the form is shortsale.
        https://www.housingeducator.org
        k3srg

        Comment


          #5
          Re: time calculation

          Steve,

          Seems like the main problem is the variable declaration "T" - this is returning a number that doesn't seem to make sense... I'm getting 0 00 00 12:07:08 at 9:15am.

          Declare as Dim Shared Calla and Dim Shared Callb

          Now, use the CTOT function to find the difference.

          calltime = ctot(callb) - ctot(calla)

          e.g. with a time for Calla of 9:15:09 and a time for Callb of 9:16:52 I get an EndTime of 0:02. Is that what you want? Is EndTime in Hours:Minutes? So this call would be 2 Minutes?

          Comment


            #6
            Re: time calculation

            Right on david, that is what i'm looking for, have you taken your computer clock and pushed it ahead after the calla var starts and see if the call time measures the time past the next hour mark correctly. I have played with this for about a week. Mainly because i want to learn the many ways to write scripts. I'm an Alpha neub and wanna become an Alpha Superstar, or at least know the workings better.
            One More thing how in the world do i get a space after calltime in the rtf memo field. How do i add a space to a line of script
            https://www.housingeducator.org
            k3srg

            Comment


              #7
              Re: time calculation

              Steve,

              Seems like the main problem is the variable declaration "T" - this is returning a number that doesn't seem to make sense... I'm getting 0 00 00 12:07:08 at 9:15am.

              Declare as Dim Shared Calla and Dim Shared Callb

              Now, use the CTOT function to find the difference.

              calltime = ctot(callb) - ctot(calla)

              e.g. with a time for Calla of 9:15:09 and a time for Callb of 9:16:52 I get an EndTime of 0:02. Is that what you want? Is EndTime in Hours:Minutes? So this call would be 2 Minutes?

              Comment


                #8
                Re: time calculation

                I also tried...

                Dim shared calla as Y
                Dim shared callb as Y

                calla = ctot(time())
                callb = ctot(time())

                Since these are all in seconds you'd need to test to see if calltime is greater than 60 and work your time out from there.

                This was from the help file under " - (Time Subtraction) "

                Comment


                  #9
                  Re: time calculation

                  That is where it gets tricky, now i'm really lost with the greater than 60.
                  do you think i can use the totime() to convert some how.
                  https://www.housingeducator.org
                  k3srg

                  Comment


                    #10
                    Re: time calculation

                    Doesn't look like you need to worry about 60 seconds...

                    With the declarations as Y etc.

                    My start time was 9:57 am, my end time was 12:52:39 pm and the Endtime calc'd as 2:55, so that looks right. If you're not worred about the remainder seconds then it looks fine.

                    Comment


                      #11
                      Re: time calculation

                      Sweet Thanks so much for the help david
                      https://www.housingeducator.org
                      k3srg

                      Comment


                        #12
                        Re: time calculation

                        Script:OnFetch line:8
                        Dim shared calla as Y
                        Variable is of different type
                        this is what i get
                        https://www.housingeducator.org
                        k3srg

                        Comment


                          #13
                          Re: time calculation

                          When I dim'd as Y, I also change the method a bit... this is in OnFetch

                          dim shared calla as Y
                          calla = ctot(time())

                          and on the button...

                          dim vTend as C
                          dim today as C
                          dim callb as Y
                          dim calltime as n
                          dim lstnote as p
                          vTend = convert_type(time(),"c")
                          today = convert_type(date(),"c")
                          DIM lstedit AS c
                          lstedit = parentform:Lastedit.text
                          callb = ctot(time())
                          calltime = (callb - calla)

                          Comment


                            #14
                            Re: time calculation

                            this is what i get trying your way
                            Script:OnFetch line:8
                            dim shared calla as Y
                            Variable is of different type
                            i copy and pasted what you put
                            https://www.housingeducator.org
                            k3srg

                            Comment


                              #15
                              Re: time calculation

                              Steve,
                              Why do you want to use RTF memo fields for the notes fields?
                              Mike W
                              __________________________
                              "I rebel in at least small things to express to the world that I have not completely surrendered"

                              Comment

                              Working...
                              X