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

complex question

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

    complex question

    I'm new to alpha 5 web server. I want to learn how to do the following.
    I have an ms access database truck dispatch program and am converting it to the web before long. Here's what I'm after. Three main tables are involved in all loads. 1. Loadsheet 2. Picks 3. Drops. Now a fourth table called Dispatch shows all info "at a glance only" of the above three tables. Here's how: An example is I use standard programming to fill most fields, but for picks/drops I do a find first occurrence of a certain tripnumber, and have the table queried by tripnumber/pickno if dealing with pick table. I simple loop through these records and if first pass through then in a variable that holds load location ,say vcity for example,
    vcity = lcity + ", " + " " + lstate.
    If second time through:
    vcity = vcity + " / ? + lcity + ", " + " " + lstate.
    I'm sure any programmer gets the drift and jest of this. HOWEVER, here's my problem. I can do this in ms access, and in alpha5 v7 with no problem at all. HOW do I accomplish this using the web part of alpha 5? I figured out the grids and child stuff for the loadsheet and pick/drop tables. But how do I loop through and write to the dispatch table? Please be detailed, I don't even know where to put code. If some one knows please let me know. Bear in mind, a load might have 3 picks, this is why I put all in a quick view dispatch table for quick viewing and decision making.

    #2
    If you have coded this already in Alpha you can place the code (minus any user interface calls) in a grid event, dialog event or on a A5 page.

    Steve

    Comment


      #3
      code

      If I sent you my alpha5 code, could you then tell me exactly how it would go in a web application?

      Comment


        #4
        Sure. I would be happy to assist as I am sure the others on the forum would as well.

        Steve

        Comment


          #5
          code

          In the below code, I first get the current trionumber into this global variable
          :vtripno1.
          Then this script is run.
          'code to loop and get various receivers. I used vcarrier as variable, but it's
          'getting shippers which is correct, I just named the variable vcarrier
          'This works like a champ in alpha5 v7. I'd like to achieve this same example in 'a web database/page, or whatever you call it.

          'CODE START:
          dim tbl as P
          dim tbl1 as P
          dim indx as P
          dim count as N
          dim vcarrier as c
          dim kount as n
          dim tbl as P
          dim indx as P
          dim count as N
          dim vdtripno as c
          vdtripno = vtripno1
          a5.command("VIEW_TRACE")
          tbl = table.open("drops")
          query.filter = "Tripno = vdtripno"
          query.order = "Tripno+str(Dropno,19,5)"
          query.options = "t"
          indx = tbl.query_create()
          count = indx.records_get()
          tbl.fetch_first()
          kount = 0
          while .NOT. tbl.fetch_eof()
          kount = kount + 1
          'tbl.change_begin(.t.)
          if kount = 1 then
          vcarrier = alltrim(tbl.Consignee)
          end if
          if kount > 1 then
          vcarrier = vcarrier + " / " + alltrim(tbl.Consignee)
          end if
          tbl.fetch_next()
          end while
          indx.close()
          tbl.close()
          ' ui_msg_box("Record Count", "" + count) used to test, worked
          ' END PART 1************************************
          'below code write to dispatch table the above results.

          'BEGIN PART 2

          dim shared vtripno as C
          dim shared varC_result as C
          dim shared recnum as N
          dim thiskey as C
          dim shared varC_result as C
          tbl1 = table.open("dispatch",file_rw_exclusive)
          tbl1.index_primary_put("tripno")
          varC_result = vdtripno
          thiskey = varC_result
          recnum = tbl1.fetch_find(thiskey)
          if (recnum > 0) then
          tbl1.fetch_goto(recnum)
          tbl1.change_begin()
          tbl1.Consignee = vcarrier
          tbl1.change_end(.t.)
          else
          tbl1.enter_begin()
          tbl1.tripno = varC_result
          tbl1.Consignee = vcarrier
          tbl1.enter_end(.t.)
          end if

          tbl1.close()

          Comment


            #6
            Jim:

            You can put this code on an a5 page. Create a blank a5 page and put your code between <%a5 and %>. Just load the page in the manner of your choosing and the code will run. For example, you could open the page via a link, button or off a menu. It can also be run from event section of a grid or a dialog. I run similiar code from dialog boxes.

            Steve

            Comment


              #7
              How would I get the tripnumber into a variable vtripno1 like I did in alpha5? And How would I get the page you mentioned to act on this variable? The code has to have a starting point, or something to act on, like vtripno1. Remember I am totally dumb to web pages, but want to learn. Say I have a linked grid which shows the loads and pick/drops on one page. One load under loadsheet, and 2 child tables picks / drops. I can do this already with no programming. OK, I want to put the tripnumber on current pate into a variable called vtripno1 ----HOW? Then have a link to the page you mentioned act on this variable ---How? In other words I just need that first step to get started. I don't even know how to assign the variable on the web page. This part is easy in alpha5 v7.

              Comment


                #8
                Jim:

                Take a look at dialog boxes in the web demo. A dialog box allows you to assign a variable and then act on it. In this case you could put your code in the validate event on the dialog. For example, a dialog coould employ a drop down box that has your choices. The choice can then be assigned to a session variable which can be used during your web session. You would have to rename the variable in your code to indicate that it is a session variable. I would stringly suggest you take a look at the Web tututorial. I t hink a lot of what I am saying will begin to make sense.

                Explain how the variable you mentioned is selected and when. There may be other methods depending on how you need the code to execute. Once we determine how and when the code is going to execute, we can decide the best way to kick off the page and your code.

                Comment


                  #9
                  variable

                  I would want the variable auto selected via whatever the current tripno (tripnumber) is. So if I just added or edited a trip, a submit button would not only save my changes, but get that variable to run the above code we've talked about. However, all of this needs to be done in the background with NO user having to do anything but save their changes. That's the whole idea of programming, most users aren't smart enough to handle some task, therefore the programmer puts these task in the background. The tasks are taken care of without the user ever knowing how. All the user needs to see is the dispatch sheet updated.

                  Comment


                    #10
                    OK - That is a bit clearer now. The code will have to be part of the afterupdaterecord event. There is a way to take a value from the grid assign it to avariable and run your code. I am off to a meeting and I will get back to you.

                    Comment


                      #11
                      Jim:

                      Check out this page in the help file.

                      "Using variables on A5W pages"

                      It lays out the use of variables in grid events. The following code could be used to read the data in your grid control and assign it to a variable.

                      Code:
                      dim session.testname as C
                      
                      session.lastname = args.datasubmitted.r1.Last_name
                      The session variable will then be used in your code which can be placed in the event I mentioned in the earlier post.

                      Comment


                        #12
                        thanks

                        I will read and try this from the help file, thanks.
                        Answer one more question: If I do get all this working, and later decide to use the data2theweb, or an ADO ODBC database (still on the alpha web server), will the same variable technique work? Sorry to over ask, just new to all of this.

                        Comment


                          #13
                          JIm:

                          I have seen examples on this board of using xbasic to manipulate data housed in other formats. Check the Datatotheweb forum here. It is also possible to manipulate ADO ODBC data with xbasic as well. Clearly you will not have the degree of flexibilty and power working outside the current native Alpha dbf format.

                          Comment


                            #14
                            Hi Steve,

                            This is exactly what i have been trying to do for 2 days.

                            I have a grid component with (amongst others) a numeric field called 'asset_id' which already contains a number from the assets table. On the same a5w page, I have created a button to open and display an 'add new record only' grid. When the new grid opens, i am trying to create a session.vasset_id variable, so i can auto populate the asset_id field in the add new record grid. I can do the auto populate bit, but cant seem to get my head around creating the session.vasset_id variable.

                            I have read the 'Using variables on A5W pages' but it didnt help me very much.

                            Comment

                            Working...
                            X