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

Choice Box

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

    Choice Box

    I have a choice button box setup with three choices on the form itself and the code below. Based on the code below that someone here helped with, a box pops up on the screen with 3 choice buttons button on there with choice 3 as a default, and you can click another choice like choice 2, and press enter and then the selection box goes away. But on the form itself, the box never indicates a choice. I am sure I don't know what I'm doing. But I would want the box on the form to indicate that I'm made choice 2 of the radio buttons if that is what I chose. Cosmetically I think what I have now is a mess. Functionally it works.



    ''XBasic
    'Present a list of choices as radio buttons.
    'Only one choice can be selected.
    '-------------------------------------------
    choice = ui_get_radio("Choose Product",3,"Oil","Gas","All Products")
    'If user presses Cancel, end the script.
    '---------------------------------------
    IF choice = "" THEN
    END
    END IF
    trace.writeln(choice)

    #2
    RE: Choice Box

    Hi Bruce,
    It seems I have been playing with radio buttons a lot lately trying to switch Indexes. Try this - assuming the field on the form is called radio1:

    choice = ui_get_radio("Choose Product",3,"Oil","Gas","All Products")
    'If user presses Cancel, end the script.
    '---------------------------------------
    SELECT
    case choice = ""
    goto ENDIT
    case choice = "Oil"
    radio1.value = "Oil"
    case choice = "Gas"
    radio1.value = "Gas"
    case choice = "All Products"
    radio1.value = "All Products"
    END SELECT
    :ENDIT
    if choice = "" then
    trace.writeln("User cancelled")
    else
    trace.writeln(choice)
    end if
    radio1.refresh()
    end

    I didn't test it, but it 'should' work ;-) Robin

    Comment


      #3
      RE: Choice Box

      I just now found the reply, but I pasted your code behind that check box and it gave me a message of "missing or invalid keyword"

      Can you figure what it needs from that?

      Thanks,


      Bruce

      Comment


        #4
        RE: Choice Box

        Robin --- if I may
        Bruce:

        Part of the power of Alpha is the help it can give about a syntax problem like you're experiencing.

        Open the script for editing and be sure that you have a blinking cursor anywhere within the script. Press F4 and you'll see the error in the lower left of the frame -- it will move your cursor to the suspect line and tell you the line number. Examine that line and see what's wrong. The pasted script appears O.K. but glancing can't be as efficient as Alpha's look at it.

        Let us all know how you did.

        Ken

        Comment


          #5
          RE: Choice Box

          The message of missing or invalid keyword is occuring on the line shown as:

          ":ENDIT"

          I copied the script exactly as I saw it here in the script.

          Comment


            #6
            RE: Choice Box

            Bruce,

            instead of

            :ENDIT

            try


            Code:
            ENDIT:
            -- tom

            Comment


              #7
              RE: Choice Box

              Ok, that fixed the script as it was at that point.

              Now, I'm trying to add something to the script so that when a choice is made in the choice box, that it can pass a variable value along. Listed below

              case choice = "Gas"
              radio1.value = "Gas"
              prodcode = "04" (already declared variable as C) in top of script.

              Then the report that I am trying to preview has a filter expression as listed below. Apparently the field Pr_Cde is not receiving the variable assigment as I would have it to do here in this case. Why not? It keeps saying prodcode not found.

              Property_Name=Var-"Namex.AND.S_Mnth"=Var-"Beg_Month.AND.S_Mnth"=Var-"End_Month.AND.Pr_Cde"=Var-"prodcode

              Comment


                #8
                RE: Choice Box

                Bruce,

                If you care to post a working copy of the database here, with directions to the script and report in question, we can help you without playing 20 questions blindfolded. The kind of error you're seeing suggests that maybe the variable declarations are insufficient for the report process to 'see' the variables. i.e. the ProdCode variable may not be in scope when the filter expression in your report is evaluated. But this is just a guess since I can't see the whole picture.

                -- tom

                Comment


                  #9
                  RE: Choice Box

                  I'd be happy to send a working copy if I could get the size down to 1Mb zipped. I keep having trouble getting that done.

                  Comment


                    #10
                    RE: Choice Box

                    We wouldn't need all the data, just a representative sampling. We wouldn't need all the tables and sets, just the ones involved in the problem. We do need the database dictionaries and the dictionaries for all tables or sets involved in the problem.

                    -- tom

                    Comment


                      #11
                      RE: Choice Box

                      Compression with a zip utility is another great way to get the size down to manageable levels.

                      -- tom

                      Comment


                        #12
                        RE: Choice Box

                        Tom - If I may....

                        Bruce:
                        Your variable is not being 'seen' by the report filter. I've had that and found that when I declare the variables as 'global' they will be seen in the report filter [in fact, everywhere in the system for that whole session]. Try that with the product code, at least and see how it plays.

                        Start your script with
                        dim global prodcode as c

                        Ken

                        Let us know how you do

                        Comment


                          #13
                          RE: Choice Box

                          Ok, I have a sample database with the form and report I want to work.

                          Just go in and try to run the form in this database and note that the variable prodcode is not found even though in the object radio1, I have the global declaration as I understand it to be: dim global prodcode as C

                          On the start and end year, use 2003, since I accidentally deleted the records I had for 2004.

                          Thanks,

                          Bruce

                          Comment


                            #14
                            RE: Choice Box

                            Bruce,

                            I took a look. Your form has a radio button tied to a field in one of your tables. This is probably unwise. If you ever succeed in getting the second radio button to work correctly you'll be writing directly to the table when you refresh radio1. You don't want to write to the table, right?

                            The OnArrive event for the radio button may contain errors. Again, are you trying to write field values to a record in your table?

                            If this form is designed to permit someone to input parameters for a filtered report I suggest:

                            a) Base radio1 on a variable, not a table field;

                            b) Abandon the onArrive script. I see no reason to launch another radio button just to get a selection to assign to the radio control on the form already. Instead put a button on the form and let the button's OnPush event read values from all the controls on the form assigning them to the variables you need for your query. It could also call the report for you.

                            c) if the variables you need to populate are defined in the report layout make certain they have the right scope when used in your form.

                            -- tom

                            Comment


                              #15
                              RE: Choice Box

                              Bruce,

                              Maybe this will get you going again.

                              Unzip the attachment and extract its contents to an empty folder.

                              -- tom

                              Comment

                              Working...
                              X