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

Data entry w/xbasic

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

    Data entry w/xbasic

    Rather than having someone write the code, I'm hoping for a bit of direction with this problem:

    I have a file with 2 fields: "Date", a date field, and "Who" a character field. The dates are already filled in, from Jan 1 to Dec 31. (Thanks to Stan M.)

    I want to fill in the names of 3 people on a rotating basis as follows:

    Pseudo code:

    For Friday, Saturday, and Sunday, January 7, 8, and 9, set the "who" field to "Sally."

    For the next Friday, Saturday & Sunday, January 14, 15, and 16, set the "who" field to "Sarah".

    For the next Friday, Saturday, & Sunday, January 21, 22, and 23, set the "who" field to "Sammy".

    Repeat the pattern: (Sally, Sarah, Sammy) for the rest of the weekends of the year.

    Is this the time to use "case"?

    Please don't write the code for me; I'm working to learn xbasic, and just want a bit of direction.

    Many thanks!

    --Rob
    Last edited by RobPolley; 01-13-2011, 02:02 PM. Reason: More completely described now.

    #2
    Re: Data entry w/xbasic

    More complete pseudo code:

    open the table
    ensure that the table is in date order
    goto the first record
    start a while loop that doesn't stop until the last record is processed
    skip records until the date field is a Friday (dow(date) = 6) and we don't reach the end of the table
    start a for-next loop to process 3 records
    begin a change
    set the who field to "Sally"
    end the change
    goto the next record
    end the for-next loop after 3
    skip records until the date field is a Friday (dow(date) = 6) and we don't reach the end of the table
    start a for-next loop to process 3 records
    begin a change
    set the who field to "Sarah"
    end the change
    goto the next record
    end the for-next loop after 3
    skip records until the date field is a Friday (dow(date) = 6) and we don't reach the end of the table
    start a for-next loop to process 3 records
    begin a change
    set the who field to "Sammy"
    end the change
    goto the next record
    end the for-next loop after 3
    end the while loop when the end of the table is reached
    close the table
    There can be only one.

    Comment


      #3
      Re: Data entry w/xbasic

      Stan,

      Awesome!

      Thank you!

      --Rob

      Comment


        #4
        Re: Data entry w/xbasic

        Rob,
        I believ you are asking for strategy/approach. OK

        What you will be doing is going to be a single pass through the table. Assuming that the table has 365 record representing one record for each day of the year, I would begin by packing the table to assure the record number corresponds with the day number. You will have to know which record number is the first Friday.

        The pattern is a pass through the table with a repeating loop through the names and a repeating loop through three increments (writing the name to three consecutive records) and a jumping forward 4 records to start the 3 increments again. If you have the names as a list in a variable, then you can refer to name position with the word() function, using an incrementing numeric variable for the name position number. This numeric variable will get incremented after the three records for that name are written to the table and when that incremented numeric variable reaches 4, it gets reset to 1. The passing through the table can use the tbl.fetch_goto() function using a numeric variable for the record number. After you get it to the first Friday record, that recno variable will be incremented to get to the next record within the loop of writing to the table, then 4 added to it to get to the next Friday. When that variable reaches 366, the script ends.

        It looks like a fun exercise, I think I'll give it a whirl. Good luck.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Re: Data entry w/xbasic

          Rob,

          Do not open except in case of emergency.
          There can be only one.

          Comment


            #6
            Re: Data entry w/xbasic

            That was fun. I'll give you my emergency code too, so you can compare approaches. I think it might be a bit shorter than Stan's, but hard to say.
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #7
              Re: Data entry w/xbasic

              Wow, thank you both, Mike & Stan!!!

              Much different approaches.

              I have to admit, I'm having some difficulty learning to program. I did buy and read "Programming For Dummies" which has been helpful.

              I suppose it's standard to feel this way at the beginning.

              Thanks, again!

              --Rob

              Comment


                #8
                Re: Data entry w/xbasic

                If your interested in xbasic, you might try Dr. Peter Wayne's book "xbasic for everyone". That's what I started with. And Stan and others filled in the gaps. This exercise was really a bit more complicated in startegy than actual coding. This is one that maybe is best, at the start, to have mapped on paper and then set to code by flow diagramming.
                Last edited by Mike Wilson; 01-15-2011, 01:08 AM.
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                  #9
                  Re: Data entry w/xbasic

                  Mike,

                  I have read it, thank you. Were you a programmer before learning basic?

                  Thanks!

                  Rob

                  Comment


                    #10
                    Re: Data entry w/xbasic

                    Dr. Peter Wayne's book "xbasic for everyone".
                    One of the best I ever read. Still have it and still reference it.


                    .
                    Dave Mason
                    [email protected]
                    Skype is dave.mason46

                    Comment


                      #11
                      Re: Data entry w/xbasic

                      Originally posted by RobPolley View Post
                      Mike,
                      Were you a programmer before learning basic?
                      No, I am a physician. I would say just like Peter Wayne, but I have not nearly the insight and skill that he does.
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Re: Data entry w/xbasic

                        Wow. Is xbasic the first programming language you learned?

                        Comment


                          #13
                          Re: Data entry w/xbasic

                          for me, languages(most forgotten)

                          dbase, basic, c, c++, vb, foxpro, clipper, god I am getting old and can't remember more???\\


                          LOL

                          Have a nice day
                          Dave Mason
                          [email protected]
                          Skype is dave.mason46

                          Comment


                            #14
                            Re: Data entry w/xbasic

                            I'm just a hacker, really. Unlike many folks like Dave, DOS, then I learned WordPerfect 5.1 macro scripting. Quite robust. I built several report centered applications with Wordperfect. Tried to learn Visual Basic and MSAccess. I gave up. Then I found Alpha, and XBasic/Xdialog, and it made sense, mostly. My biggest struggles were and still are, filters and filter syntax, and understanding the full power and use of dot variables.
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment


                              #15
                              Re: Data entry w/xbasic

                              What helped me with filters was the thinking. Once I got that straight, it was a lot easier.

                              Oil filter on a car filters out what we don't want(dirt) and leaves clean oil

                              xbasic/program filter filters in what we do want which is information and leaves out the dirt.


                              And Thanks Mike
                              Dave Mason
                              [email protected]
                              Skype is dave.mason46

                              Comment

                              Working...
                              X