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

  • Keith Hubert
    replied
    Re: Can you help me with my first Summarize operation?

    Sam,
    lets you select a variable "var" but doesn't explain the context within which it will be used
    If you mean the scope of the variable, that is left to you when you create the variable in the first place.

    Leave a comment:


  • forskare
    replied
    Re: Can you help me with my first Summarize operation?

    Originally posted by Al Buchholz View Post
    Nah, I think it's the Mn. part of him..
    You guys are right. I know you've heard of 'Minnesota Nice' so that's what I did. I said something nice. Every product has, as Stan say, it's oddities and Alpha is no exception. If they ever get even mediocre documentation, I could easily cut my time in half. Overall, I love Alpha 5.

    Leave a comment:


  • Al Buchholz
    replied
    Re: Can you help me with my first Summarize operation?

    Originally posted by Stan Mathews View Post
    So that's the reason you're, well like you are........
    Nah, I think it's the Mn. part of him..

    Leave a comment:


  • Stan Mathews
    replied
    Re: Can you help me with my first Summarize operation?

    So that's the reason you're, well like you are........

    Leave a comment:


  • forskare
    replied
    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.

    Leave a comment:


  • Stan Mathews
    replied
    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?

    Leave a comment:


  • sgerber
    replied
    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.

    Leave a comment:


  • Stan Mathews
    replied
    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.

    Leave a comment:


  • sgerber
    replied
    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

    Leave a comment:


  • Stan Mathews
    replied
    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)

    Leave a comment:


  • sgerber
    replied
    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.

    Leave a comment:


  • Stan Mathews
    replied
    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.

    Leave a comment:


  • sgerber
    replied
    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.

    Leave a comment:


  • Stan Mathews
    replied
    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?

    Leave a comment:


  • forskare
    replied
    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.

    Leave a comment:

Working...
X