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

Can you help me with my first Summarize operation?

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

  • Can you help me with my first Summarize operation?

    I need to create a Version 11 XBASIC script to summarize, update, then post data from one of my tables to a destination table. Since I'm lousy at V11's XBASIC I figured I would try to use the Control Panel's Operation feature. My intent was to define the operation without using its Genii because the screens are indentical to those I've used in Version 1. Well, it's not being very accommodating.

    I selected my table name, gave it the name of my results table and began entering. First I entered a field "cust_sn" with a summarization of "Group By" and then "inv_date" with "max". I took a peek at the Xbasic it's generating and it looked great, lots of summarization syntax. Then I entered my 3rd field which is really an expression. I used the down arrow to select "expression" and the Expression Builder dialogue opened up and I entered my expression.

    I then took a look at the Xbasic it was generating and it was blank. No Xbasic at all. I remove the expression and the previous Xbasic has returned. This is a very hostile thing to do to a newbie! :>) So my first question is why won't it let me enter expressions?

    Assuming I get past this obstacle, the Summarization I want will require 2 user input variables. This software appears to be "variable friendly" so I clicked "var" and entered my first variable and variable type. This dialogue closes and there's no variable anywhere. I tried to RUN to see if I would be prompted and received an error.

    Please don't ask me to use Alpha's Help facility. I did and it totally stunk. Instead of leading me through this from A to Z, it stopped at B. Doesn't even mention variables let alone guide me through entering them.

    Well I'm stuck and unhappy. Are there any kind souls out there who can steer me through this?

    Thanks ... Sam

  • #2
    Re: Can you help me with my first Summarize operation?

    Originally posted by sgerber View Post
    My intent was to define the operation without using its Genii because the screens are indentical to those I've used in Version 1. Well, it's not being very accommodating.
    Did you try using the Genies? V1 is more than prehistoric, to say the least. You need to put how you did things in V1 out of mind and concentrate on how v11 does it. That's what the genies are for.
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    Comment


    • #3
      Re: Can you help me with my first Summarize operation?

      Ken, my two issues are:
      1. Not being allowed to see generated Xbasic for the entered Summarize operations once I've entered an expression.
      2. Variables are not inserted into the Xbasic even though I clicked "var" and responded to the dialogue.

      Are you telling me with certainty I'll be able to do this if I switch to the Genii?

      BTW, I had Alpha V1 and Alpha V11 on the screen at the same time and I was cutting and pasting the 16 year old expressions into V11's expression builder. It's easier to do it without the Genii. All the expressions in my application have worked so far in V11 so why should I forget everything I ever knew about Version 1? Also, my 16 year-old GUI coding works also, so I don't think I should unlearn that either.

      Another thing Ken, it would be easier for "newbies" to A11 if the help facility was actually helpful. I learned nothing new about Summarization from the Help. In fact the word "summarization" yields no hits. You have to enter "summarize". That serious flaw is riddled throughout the "Help" where it takes forever to find what you're looking for unless you know the precise technical term for what it is you're looking for. Look up "calculating totals" if you think I'm just whining.

      Ken, I know you're smart with Alpha Five, but please don't lose empathy with people who are new to the current version, or worse, total newbies. Alpha Five is very hard to learn when you venture into many areas like scripting.

      Comment


      • #4
        Re: Can you help me with my first Summarize operation?

        Originally posted by sgerber View Post
        Are you telling me with certainty I'll be able to do this if I switch to the Genii?
        No, I'm not. But, until you try it........ You can work through the Genies at a pretty good clip. What have you got to loose but a lot of time trying to ge the correct xbasic?

        Another thing Ken, it would be easier for "newbies" to A11 if the help facility was actually helpful.
        Ha! One does not need to be a newbie to realize the "Help" really isn't very helpful. Many of the subjects only give a bit of sample code with no instructions on how to use it. As such, for someone to use the code as is, they already know what to do so .......

        I learned nothing new about Summarization from the Help. In fact the word "summarization" yields no hits. You have to enter "summarize". That serious flaw is riddled throughout the "Help" where it takes forever to find what you're looking for unless you know the precise technical term for what it is you're looking for. Look up "calculating totals" if you think I'm just whining.
        Searching the WIKI is not easy. In many cases, it easier to use Google and no, you're not whining. I bet most seasoned users will whole heartily agree with you, including me.

        Ken, I know you're smart with Alpha Five, but please don't lose empathy with people who are new to the current version, or worse, total newbies. Alpha Five is very hard to learn when you venture into many areas like scripting.
        Sam, you know a whole lot more about Xbasic that I. Newbies to A5 should not try to learn Xbasic. Use the Genies and Action Scripting. All AS can be converte3d to xbasic if one wants to see that. Use the genies as much as possible if for no other reason than to save time.
        TYVM :) kenn

        Knowing what you can achieve will not become reality until you imagine and explore.

        Comment


        • #5
          Re: Can you help me with my first Summarize operation?

          If I open AlphaSports, choose the invoice.set, create operation, summarize (use the genie).

          result table name test.dbf
          field invoice_number groupby
          field date max
          expression Invoice_Items->Price*Invoice_Items->Quantity total

          and view the xbasic I see....

          tbl = table.current()
          sum.db = "test.DBF"
          sum.db_dd_delete = .F.
          sum.result_overwrite = .F.
          sum.order = "INVOICE_NUMBER"
          sum.filter = ""
          sum.options = "I"
          sum.fields = 3
          sum.field1 = "Invoice_Number"
          sum.code1 = 0
          sum.field2 = "Date"
          sum.code2 = 4
          sum.field3 = "Invoice_Items->Quantity*Invoice_Items->Price"
          sum.code3 = 1
          tbl.summarize()

          What do you see?
          There can be only one.

          Comment


          • #6
            Re: Can you help me with my first Summarize operation?

            Actually Ken I have it working. It would have been nice if the Operations software didn't give me grief.

            I had 4 expressions using conditionals, so I cheated it and gave it 4 regular fields just so it would cough up the Xbasic I wanted.

            I took its "sum.field4 = "inv_dte" and pasted in my 15 year old expression and ended up with:
            sum.field4 = "IF(INV_DATE>=VAR->P_DATE1, SUB_TOT + CEILING((SUB_TOT+SHIP_FEE+COD_FEE) * TAX_RATE)/100 + SHIP_FEE + COD_FEE, 0)". I front-ended it with my 15 year old GUI to prompt for the variables, got lucky and the summarization ran first time thru.

            It's just not right that we have to work so hard and long.

            Comment


            • #7
              Re: Can you help me with my first Summarize operation?

              Xbasic, these days, is picky about the scope of the variables you use in a script.

              To protect yourself against unintended behavior you should dim all variables used in the script with the same scope they have when initially declared. This means if you have a button which asks for the variables and you don't dim them explicitly as wider than local scope, another button that runs the summarize operation will have no visibility of the variables.
              There can be only one.

              Comment


              • #8
                Re: Can you help me with my first Summarize operation?

                I ran into that one, Stan. Cost me more than an hour. DIM SHARED in XBASIC and GLOBAL in the form, I think.

                Comment


                • #9
                  Re: Can you help me with my first Summarize operation?

                  Originally posted by sgerber View Post
                  sum.field4 = "IF(INV_DATE>=VAR->P_DATE1, SUB_TOT + CEILING((SUB_TOT+SHIP_FEE+COD_FEE) * TAX_RATE)/100 + SHIP_FEE + COD_FEE, 0)"
                  This works it the var->P_DATE1 is appropriately dimmed previously. Selwyn has said that it shouldn't and that he would change that behavior if it wouldn't break a lot of applications that rely on it. (link to thread)

                  Alpha should, in all cases, treat anything inside quotes as text. In the line above the value of VAR->P_DATE1 shouldn't actually be used. The line should be written as

                  Originally posted by sgerber View Post
                  sum.field4 = "IF(INV_DATE>={"+dtoc(VAR->P_DATE1)+"}, SUB_TOT + CEILING((SUB_TOT+SHIP_FEE+COD_FEE) * TAX_RATE)/100 + SHIP_FEE + COD_FEE, 0)"
                  or some equivalent.

                  Try the following as the onpush for a button.


                  Code:
                  dim myvar1 as C
                  myvar1 = "Test number one."
                  ui_msg_box("Test 1","Unseen variable var->myvar1")
                  
                  dim shared myvar2 as C
                  myvar1 = "Test number two."
                  ui_msg_box("Test 2","Unseen variable var->myvar2")
                  
                  dim global myvar3 as C
                  myvar1 = "Test number three."
                  ui_msg_box("Test 3","Unseen variable var->myvar3")
                  
                  ui_msg_box("Test 1a","Exposed variable ---"+var->myvar1)
                  There can be only one.

                  Comment


                  • #10
                    Re: Can you help me with my first Summarize operation?

                    Stan, sorry but I've lost sight of how this discussion of the lasting value of variables is related to my difficulty with the Summarization operation.

                    As yet I do not know how to interject variables in that wizard. It pops a dialogue, I enter the variable, and I never see it again. Have no idea how to enter it, if it even can be entered. And the help, as usual, is worthless. Doesn't even mention variables.

                    As for the part of your post that questions whether variables can be expressed within quotes, I see no reason why not. All the other syntax works so why not variables as well. I hope to heck Selwyn sticks to his plan and leaves it alone. I have enough problems without him adding to them.

                    ??? Sam

                    Comment


                    • #11
                      Re: Can you help me with my first Summarize operation?

                      We could debate all day whether something should/shouldn't be. We're stuck with what is.

                      This discussion has to do with how to modify the xbasic of the genie generated summarize operation to make it do things the genie is incapable of doing. The genie is designed to help with the basics. It is not intended to satisfy every twist a user might envision.

                      If faced with the situation you encountered I would have hard coded a date

                      Code:
                      sum.field4 = "IF(INV_DATE>={09/01/2012}, SUB_TOT + CEILING((SUB_TOT+SHIP_FEE+COD_FEE) * TAX_RATE)/100 + SHIP_FEE + COD_FEE, 0)"
                      and then modified that line to reference my variable.
                      There can be only one.

                      Comment


                      • #12
                        Re: Can you help me with my first Summarize operation?

                        The odd thing is, Stan, is that it lets you select a variable "var" but doesn't explain the context within which it will be used.

                        Comment


                        • #13
                          Re: Can you help me with my first Summarize operation?

                          If you want to investigate oddities take a look at the properites of a field on a report or label. You can set such fields to be disabled or tab stops.

                          In what context would one want to do that?
                          There can be only one.

                          Comment


                          • #14
                            Re: Can you help me with my first Summarize operation?

                            Yup, I sent an email to Alpha years ago about that and of course, I'm still holding my breath.
                            TYVM :) kenn

                            Knowing what you can achieve will not become reality until you imagine and explore.

                            Comment


                            • #15
                              Re: Can you help me with my first Summarize operation?

                              So that's the reason you're, well like you are........
                              There can be only one.

                              Comment

                              Working...
                              X