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

update to yield a space character

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

    #16
    Re: update to yield a space character

    Always a pleasure to actually win something!
    Hope John can use it.
    See our Hybrid Option here;
    https://hybridapps.example-software.com/


    Apologies to anyone I haven't managed to upset yet.
    You are held in a queue and I will get to you soon.

    Comment


      #17
      Re: update to yield a space character

      Ted,

      Great idea. I've never quite thought of using a calculated field quite like that before. I've only thought in terms of applying math to a field.
      That will open up some possibilities for future projects.

      Works great !

      Here's the code with my field names present: DTOC(DATE)+" "+TIME("0h:0m", TIME)

      Thanks.

      Comment


        #18
        Re: update to yield a space character

        Thank you John. Like Tom and Stan, I've been ducking and diving with AS for years.
        As Tom said, old school. Shows my age I suppose.
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        Apologies to anyone I haven't managed to upset yet.
        You are held in a queue and I will get to you soon.

        Comment


          #19
          Re: update to yield a space character

          Originally posted by Ted Giles View Post
          No but you can do this;
          DTOC(THIS_DATE)+" "+TIME("0h:0m", THIS_TIME)

          I made an additional field in the table which is a Calculated construct of the THIS_DATE fields which is just Date, and the Short Time field THIS_TIME.
          When exported, the data in Notepad looks like this.

          13/06/2014 09:05 The spaces are there. You may have to play with the Delimeters.
          Not sure if this actually works. time() works on a long time T not short time Y type filed.

          But regardless, why work too hard when you could do this:
          date+" "+time
          Where date is type D and time is type Y ,which will yield the following:
          Code:
          dim date as d
          dim time as Y
          date=date()
          time="08:20 pm"
          ?date+" "+time
          = "06/14/2014 08:20:00 00 pm"
          And if the extra zero (seconds, milliseconds) are undesirable, you could do this:

          Code:
          ?time("MM/dd/yyyy 0h:0m am", ctodt(date+" "+time))
          = "06/14/2014 08:20 pm"
          But to the main question, which is in reality how to convert a dbf file to a csv file and asides from the fact that there are a lot of third party software/shareware to do that, you could do this by several means without adding any more fields nor using any third party software.
          For instance, you could:
          1-Export the file to Excel as csv and combine the fields in Excel , or (what I would personally do)
          2-Intialize the table in an array and dump the array into a text file.

          Comment


            #20
            Re: update to yield a space character

            He doesn't want the am or pm either G, and is capturing the time in a separate field.
            So what benefit does using an Array have over a calculated field?
            Won't you still need to format the time element?
            Last edited by Ted Giles; 06-15-2014, 03:09 AM.
            See our Hybrid Option here;
            https://hybridapps.example-software.com/


            Apologies to anyone I haven't managed to upset yet.
            You are held in a queue and I will get to you soon.

            Comment


              #21
              Re: update to yield a space character

              Originally posted by Ted Giles View Post
              He doesn't want the am or pm either
              You could do this:
              Code:
              ?time("MM/dd/yyyy 0h:0m", ctodt(date+" "+time))
              = "06/14/2014 08:20"
              Which does not make sense to me. How would you know if it's 8:20 am or 8:20 pm? Unless either it doesn't matter, or you don't care, or you live in the North or South Pole, or, it's a military time, which I might have overlooked.

              Originally posted by Ted Giles View Post
              So what benefit does using an Array have over a calculated field?
              Why add more fields to the table when you don't have to? particularly, calc field? and just for the purpose of exporting? It's like eating your steak with a cleaver and a pitch fork....... Doable.... not so royal.

              Comment


                #22
                Re: update to yield a space character

                You could do this:

                Code:
                ?time("MM/dd/yyyy 0h:0m", ctodt(date+" "+time))
                = "06/14/2014 08:20"
                I don't think it works in an Alpha Export Operation. That is the problem and why I went for the Calculated Field. It is also easier to understand, quicker to do and easier to test.

                2-Intialize the table in an array and dump the array into a text file.
                I'm interested in this approach never having used arrays in Alpha (3/4 dimensional in SOBS Basic yes, but not had any need to use them in Alpha).
                Can you show us the code which would give the date [space] time HH:MM like - [01/01/1900[ ] 12:45] from a Table which can be placed into a CSV file using whatever "dump" routine you would use please?
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment


                  #23
                  Re: update to yield a space character

                  Create a simple table, let's call it "Ted" with the following fields:
                  date D
                  Time Y
                  Run this script:
                  Code:
                  cnt=tablecount("ted",".t.")
                  dim arr[cnt] as p
                  arr.initialize_from_table("ted")
                  for i=1 to cnt
                  	arr[i].both=time("MM/dd/yyyy 0h:0m",ctodt(arr[i].date+" "+arr[i].time))
                  	next
                  txt=arr.dump_properties("both")	
                  msgbox(txt)
                  You could save the contents of the variable txt to any text or csv file of your choice

                  Comment


                    #24
                    Re: update to yield a space character

                    Originally posted by Ted Giles View Post
                    Originally posted by G Gabriel View Post
                    You could do this:
                    ?time("MM/dd/yyyy 0h:0m", ctodt(date+" "+time))
                    = "06/14/2014 08:20"
                    I don't think it works in an Alpha Export Operation.
                    It should.

                    Comment


                      #25
                      Re: update to yield a space character

                      Thanks G. I will try it out.
                      The export doesn't work though. The space goes walkabout.
                      It should, but it don't. (Ever heard that?)
                      See our Hybrid Option here;
                      https://hybridapps.example-software.com/


                      Apologies to anyone I haven't managed to upset yet.
                      You are held in a queue and I will get to you soon.

                      Comment


                        #26
                        Re: update to yield a space character

                        I didn't try it, but the calc field shows the space.
                        At any rate, in the script I posted above, you could eliminate:
                        txt=arr.dump_properties("both")
                        and save the array to a text table directly. I put it there only for illustration.
                        You could turn this into a function.
                        I believe I posted a function in the past to convert dbf to csv.
                        Last edited by G Gabriel; 06-15-2014, 01:49 PM.

                        Comment


                          #27
                          Re: update to yield a space character

                          arr[i].both=time("MM/dd/yyyy 0h:0m",ctodt(arr[i].date+" "+arr[i].time))
                          Cool, thanks G.

                          Question and then I'll get out of your hair.

                          arr[i].both=time("MM/dd/yyyy 0h:0m",ctodt(arr[i].date+" "+arr[i].time))

                          Makes no difference how many spaces I add, but it fails in there are NO spaces. Probably means that ctodt() parses very accurately.
                          See our Hybrid Option here;
                          https://hybridapps.example-software.com/


                          Apologies to anyone I haven't managed to upset yet.
                          You are held in a queue and I will get to you soon.

                          Comment


                            #28
                            Re: update to yield a space character

                            Works for me.

                            Comment


                              #29
                              Re: update to yield a space character

                              Alas not for me Dates.PNG
                              See our Hybrid Option here;
                              https://hybridapps.example-software.com/


                              Apologies to anyone I haven't managed to upset yet.
                              You are held in a queue and I will get to you soon.

                              Comment


                                #30
                                Re: update to yield a space character

                                It is showing the date & time as desired. What's not working?

                                Comment

                                Working...
                                X