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

xdialog

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

    xdialog

    I have a xdialog box that enables a user to enter upto 5 part numbers in. What command or code can I use so that when the first part number is entered you can press "enter" to enter the next part number instead of going straight to search here is my code at present:

    'Date Created: 02-Dec-2002 04:34:39 PM
    'Last Updated: 08-Jan-2003 04:30:06 PM
    'Created By :
    'Updated By :

    dim check1 as l
    dim check2 as l
    dim check3 as l
    dim check4 as l
    dim check5 as l
    dim check6 as l
    dim check7 as l
    dim check8 as l
    dim check9 as l
    dim check10 as l
    dim part as c
    dim part1 as c
    dim part2 as c
    dim part3 as c
    dim part4 as c
    dim part5 as c

    check1=.t.
    check2=.t.
    check3=.t.
    part1=lastsearch
    dlg_title="Part number search"

    result= ui_dlg_box("Part number search", {sp=12}

    IF result = "cancel" THEN
    end
    ELSE IF result = "search" THEN

    lastsearch=part1
    ord=table.open("orders")
    wip=table.open("wipb")
    wdl=table.open("wdlb")
    sto=table.open("stock")
    rac=table.open("rack")
    sub=table.open("subpart")
    pun=table.open("pun_ben")
    wip.index_primary_put("part_no")
    wdl.index_primary_put("part")
    sto.index_primary_put("Sub_Part")
    rac.index_primary_put("Stil")
    sub.index_primary_put("Sub_Part")
    pun.index_primary_put("job")


    IF part1="" THEN
    end
    END IF

    dim rack as c
    dim partn(5) as c

    partn(1)=part1
    partn(2)=part2
    partn(3)=part3
    partn(4)=part4
    partn(5)=part5
    filename = "C:\A5\TMP\search.csv"
    f1=file.create(filename,file_rw_shared)
    Reportfile="G:\alpha5\MSM_files\partsearch.xls"
    extra=""
    comma=""
    IF check7 = .t. THEN
    extra=extra+",Price"
    comma=comma+","
    END IF
    IF check8 = .t. THEN
    Reportfile="G:\alpha5\MSM_files\partsearchl.xls"
    extra=extra+",Description"
    comma=comma+","
    END IF
    IF check9 = .t. THEN
    Reportfile="G:\alpha5\MSM_files\partsearchl.xls"
    extra=extra+",Remarks"
    comma=comma+","
    END IF
    IF check10 = .t. THEN
    Reportfile="G:\alpha5\MSM_files\partsearchl.xls"
    extra=extra+",MC info"
    END IF
    f1.write_line("Tbl,Required,Job No,Order No,Qty,Part No ,Issue ,Position"+Extra)
    f1.write_line(",Delivered,,,,,,Invoice No")

    I=1

    FOR I=1 TO 5
    part=partn(i)
    IF alltrim(part)="" THEN
    goto nexti
    END IF
    'search order table
    IF check1 = .t.
    query.description = ""
    query.order = "PART_NO+dtoc(date_req)"
    query.filter = ""
    query.options = "I"
    indx = ord.query_create()

    ord.fetch_find(part)
    IF substr(ord.Part_no,1,len(part))part THEN
    F1.write_line("Ord,,,,,"+trim(upper(part))+",,NOT FOUND")
    END IF
    WHILE part=substr(ord.Part_no,1,len(part)) .and. .not. ord.fetch_eof()
    StatusBar.Robot()
    extra=""
    IF check7 = .t. THEN
    extra=extra+",�"+ltrim(str(ord.price,9,2))
    END IF
    IF check8 = .t. THEN
    extra=extra+","+trim(chrtran(ord.Desc,","," "))
    END IF
    IF check9 = .t. THEN
    extra=extra+","+trim(chrtran(substr(ord.remarks,1,19),","," "))
    END IF
    IF check10 = .t. THEN
    extra=extra+","
    END IF
    F1.write_line("Ord,"+DTOC(ord.date_req,"9C-")+"," +ltrim(str(ord.Job_No))+"," +trim(ord.Order_no)+"," +ltrim(str(ord.Quantity))+","+trim(ord.part_No)+"," +trim(ord.Issue)+"," +trim(chrtran(ord.position,","," "))+extra)
    ord.fetch_next()
    END WHILE
    END IF
    'end of ord search


    'search wipb table
    IF check2 = .t.


    wip.fetch_find(part)
    IF substr(wip.Part_no,1,len(part))part THEN
    F1.write_line("wip,,,,,"+trim(upper(part))+",,NOT FOUND")
    END IF
    WHILE part=substr(wip.Part_no,1,len(part)) .and. .not. wip.fetch_eof()
    StatusBar.Robot()

    extra=""
    ppf= .f.
    IF check7 = .t. THEN
    extra=extra+",�"+ltrim(str(wip.price,10,2))
    END IF
    IF check8 = .t. THEN
    sub.fetch_find(wip.Part_no)
    IF wip.part_no = sub.Sub_part THEN
    extra=extra+","+trim(chrtran(sub.Desc,","," "))
    ELSE
    extra=extra+","
    END IF

    END IF
    IF check9 = .t. THEN
    extra=extra+","+trim(chrtran(substr(wip.remarks,1,19),","," "))
    END IF
    IF check10 = .t. THEN
    IF substr(wip.Position,1,5)="punch" THEN
    ppf= .t.
    pun.fetch_find(wip.job_no)
    IF wip.Job_no=pun.Job_no THEN
    extra=extra+","+pun.Machine+" "+pun.Prog+" "+pun.Priority
    ELSE
    extra=extra+","
    END IF

    ELSE
    extra=extra+","
    END IF

    END IF
    rac.fetch_find(wip.Stilage)
    pos=trim(wip.Position)+" "+trim(wip.Stilage)
    IF wip.Stilage=rac.Stilage THEN
    pos=pos+" "+trim(rac.Rack)
    END IF
    F1.write_line("wip,"+DTOC(wip.date_req,"9C-")+"," +trim(wip.Job_No)+"," +trim(wip.Order_no)+"," +ltrim(str(wip.Quantity))+","+trim(wip.part_No)+"," +trim(wip.Issue)+"," +trim(chrtran(pos,","," "))+extra)
    IF ppf = .t. THEN
    pun.fetch_next()
    WHILE pun.Job_no = wip.Job_no .and. .not. pun.fetch_eof()
    f1.write_line(",,,,,,,,"+comma+pun.Machine+" "+pun.Prog+" "+pun.Priority)
    pun.fetch_next()
    END WHILE
    END IF
    wip.fetch_next()
    END WHILE
    END IF
    'end of wip search



    'search wdlb table
    IF check3 = .t.


    wdl.fetch_find(part)
    IF substr(wdl.Part_no,1,len(part))part THEN
    F1.write_line("wdl,,,,,"+trim(upper(part))+",,NOT FOUND")
    END IF
    WHILE part=substr(wdl.Part_no,1,len(part)) .and. .not. wdl.fetch_eof()
    StatusBar.Robot()

    extra=""
    IF check7 = .t. THEN
    extra=extra+",�"+ltrim(str(wdl.price,10,2))
    END IF
    IF check8 = .t. THEN
    sub.fetch_find(wdl.Part_no)
    IF wdl.Part_no=sub.Sub_part THEN
    extra=extra+","+trim(chrtran(sub.Desc,","," "))
    ELSE
    extra=extra+","
    END IF

    END IF
    IF check9 = .t. THEN
    extra=extra+","+trim(chrtran(substr(wdl.remarks,1,19),","," "))
    END IF
    IF check10 = .t. THEN
    extra=extra+","
    END IF
    F1.write_line("wdl,"+DTOC(wdl.Inv_date,"9C-")+"," +trim(wdl.Job_No)+"," +trim(wdl.Order_no)+"," +ltrim(str(wdl.Quantity))+","+trim(wdl.part_No)+"," +trim(wdl.Issue)+"," +ltrim(str(wdl.Del_note))+extra)
    wdl.fetch_next()
    END WHILE
    END IF
    'end of wdl search


    'search sto table
    IF check4 = .t.


    sto.fetch_find(part)
    IF substr(sto.Sub_part,1,len(part))part THEN
    F1.write_line("sto,,,,,"+trim(upper(part))+",,NOT FOUND")
    END IF
    WHILE part=substr(sto.Sub_part,1,len(part)) .and. .not. sto.fetch_eof()
    StatusBar.Robot()

    extra=""
    IF check7 = .t. THEN
    extra=extra+","
    END IF
    IF check8 = .t. THEN
    sub.fetch_find(sto.sub_part)
    IF sto.sub_part=sub.Sub_part THEN
    extra=extra+","+trim(chrtran(sub.Desc,","," "))
    ELSE
    extra=extra+","
    END IF


    rac.fetch_find(sto.Stilage)
    pos=trim(sto.Position)+" "+trim(sto.Stilage)
    IF sto.Stilage=rac.Stilage THEN
    pos=pos+" "+trim(rac.Rack)
    END IF

    END IF
    IF check9 = .t. THEN
    extra=extra+","+trim(chrtran(substr(sto.remarks,1,19),","," "))
    END IF
    ppf=.f.
    IF check10= .t. THEN
    IF substr(sto.Position,1,5)="punch" THEN
    ppf= .t.
    pun.fetch_find(sto.job_no)
    IF sto.Job_no=pun.Job_no THEN
    extra=extra+","+pun.Machine+" "+pun.Prog+" "+pun.Priority
    ELSE
    extra=extra+","
    END IF

    ELSE
    extra=extra+","
    END IF
    END IF
    F1.write_line("sto,"+DTOC(sto.Date_rec,"9C-")+"," +trim(sto.Job_no)+"," +trim(sto.Supply_to)+"," +ltrim(str(sto.Quantity))+","+trim(sto.Sub_part)+"," +trim(sto.Issue)+"," +trim(Pos)+extra)
    IF ppf = .t. THEN
    pun.fetch_next()
    WHILE pun.Job_no = sto.Job_no .and. .not. pun.fetch_eof()
    f1.write_line(",,,,,,,,"+comma+pun.Machine+" "+pun.Prog+" "+pun.Priority)
    pun.fetch_next()
    END WHILE
    END IF
    sto.fetch_next()
    END WHILE
    END IF
    'end of sto search

    'search archive table

    IF check5 = .t. .or. check6= .t.
    y=4
    IF check6= .t. THEN
    y=8
    END IF

    year=year(date())
    x=year
    IF file_exists("o:\archive\warc"+ltrim(str(x))+".dbf")
    goto start
    END IF
    x=x-1
    IF file_exists("o:\archive\warc"+ltrim(str(x))+".dbf")
    goto start
    END IF
    x=x-1
    start:
    FOR x = x TO year-y step -1
    arc=table.open("o:\archive\warc"+ltrim(str(x)))
    arc.index_primary_put("part")

    arc.fetch_find(part)
    WHILE part=substr(arc.Part_no,1,len(part)) .and. .not. arc.fetch_eof()
    StatusBar.Robot()

    extra=""
    IF check7 = .t. THEN
    extra=extra+","+ltrim(str(arc.price,10,2))
    END IF
    IF check8 = .t. THEN
    sub.fetch_find(arc.Part_no)
    IF arc.Part_no=sub.Sub_part THEN
    extra=extra+","+trim(chrtran(sub.Desc,","," "))
    ELSE
    extra=extra+","
    END IF

    END IF
    IF check9 = .t. THEN
    extra=extra+","
    END IF
    IF check10 = .t. THEN
    extra=extra+","
    END IF
    F1.write_line("arc,"+DTOC(arc.Inv_Date,"9C-")+"," +arc.Job_No+"," +trim(arc.Order_no)+"," +ltrim(str(arc.quantity))+","+trim(arc.part_no)+"," +trim(arc.issue)+"," +ltrim(str(arc.del_note))+extra)
    arc.fetch_next()
    END WHILE
    arc.close()
    NEXT x


    END IF


    'end of arc search






    nexti:
    NEXT I




    StatusBar.clear()
    F1.flush()
    f1.close()
    ord.close()
    wip.close()
    wdl.close()
    sto.close()
    rac.close()
    sub.close()
    sys_open(reportfile)
    END IF

    #2
    RE: xdialog

    here's one way:


    ui_dlg_box("test", ;
    %dlg%,

    Comment


      #3
      RE: xdialog

      I have tried to use the code that you have given me in my code but I can not seem to get it running. This is how I have used your code in my script.




      result= ui_dlg_box("Part number search", {sp=12}



      %dlg%,

      Comment


        #4
        RE: xdialog

        I have worked out where my mistake was the search button had a star in front of it. Thank you for your help.

        Comment


          #5
          RE: xdialog

          Now that i have the code working it only works within the code editor not when you try and run it using other methods ie; script play

          Comment


            #6
            RE: xdialog

            Nisha,

            What a great Dialog. I have got it to work from a push button on a form. No problem with getting it to run with script run. I have made one very small adjustment.

            {region2}
            {sp}{sp}(check7) Include Prices;
            {sp}(check8) Include Description;
            {sp}(check9) Include Remarks;
            {sp}(check10) M/C'S for jobs that are position punch;

            This makes the check boxes line up better.

            Keith Hubert
            London.
            Regards
            Keith Hubert
            Alpha Guild Member
            London.
            KHDB Management Systems
            Skype = keith.hubert


            For your day-to-day Needs, you Need an Alpha Database!

            Comment


              #7
              RE: xdialog

              now i see why, when i did this for my application, i had to make it more complicated. the way i solved it was to make an array of the controls in the xdialog and then use ui_dlg_ctl_goto to move through the controls. here is a short example:

              controls_list=

              %list%

              control_count=w_count(controls_list,crlf())

              dim control_array[control_count] as c
              control_array.initialize(controls_list)

              varC_result=ui_dlg_box("test",
              %dlg%,"
              a_dlg_button="OK"
              case curr_ctrl=""
              a_dlg_button="Cancel"
              case else
              a_dlg_button=""
              curr_ctrl_number=control_array.find(curr_ctrl)
              if curr_ctrl_number=control_count then
              curr_ctrl_number=0
              end if
              next_control=control_array[curr_ctrl_number+1]
              next_control=left(next_control,len(next_control)-1)
              next_control=word(next_control,1,"!")
              next_control=word(next_control,1,"^")
              next_control=word(next_control,1,"#")
              if occurs("%",next_control)>0 then
              next_control=word(next_control,3,"%")
              end if
              while .not. isalpha(next_control)
              next_control=right(next_control,len(next_control)-1)
              end while
              ui_dlg_ctl_goto("test",next_control)
              end select
              end if
              %code%)

              some of the extra manipulation of the controls is for some of the fancier controls that aren't used in this example.

              Comment


                #8
                RE: xdialog

                Keith, I found that there is not end for the %dlg%) Is to be found in the code and I am overlooking it. Jack

                Comment


                  #9
                  RE: xdialog

                  Peter,

                  I tried an xdialog box and everything was great except I couldnt use the enter key because it would close out the box (ok). Anyway, I noticed that on your code I could enter down and the final entry was the ok. How did you do that? Im still learning xbasic so be easy!

                  Comment


                    #10
                    RE: xdialog

                    Hello David,

                    Not presuming to speak for Peter, but to answer your question - the following segment of code checks what the current control is when the ENTER key is pressed. If the current control is the OK or Cancel button, it allows that to pass through, which ends the Xdialog session. If it was any other control, it blanks out the a_dlg_button, which causes the Xdialog box to stay open.

                    case curr_ctrl=""
                    a_dlg_button="OK"
                    case curr_ctrl=""
                    a_dlg_button="Cancel"
                    case else
                    a_dlg_button=""


                    Jim

                    Comment


                      #11
                      RE: xdialog

                      Hello Peter,

                      I'm curious. The focus does not show on the buttons when using the enter key to move through the controls. Using the tab key, you can see focus arrive at the buttons.

                      I put a ui_dlg_refresh("test") command right after the
                      ui_dlg_ctl_goto("test",next_control) command. Thinking that this would show the focus on the button, but it does not.

                      Can visual focus be displayed to the user in this type of tight code control using ui_dlg_ctl_goto()?

                      Thanks,
                      Jim

                      Comment


                        #12
                        RE: xdialog

                        Jack

                        Here is the missing end tag.

                        {sp=12}
                        %dlg%,
                        Regards
                        Keith Hubert
                        Alpha Guild Member
                        London.
                        KHDB Management Systems
                        Skype = keith.hubert


                        For your day-to-day Needs, you Need an Alpha Database!

                        Comment


                          #13
                          RE: xdialog

                          jim,
                          i haven't been able to change that issue (showing focus on a button after ui_ctl_goto()). i can point it out to selwyn but it's clearly up to them whether to make it a priority--we all use xdialog with the knowledge that no warranties are given or implied!

                          Comment

                          Working...
                          X