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 not stop sequence of images displaying

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

  • Can not stop sequence of images displaying

    I am trying to display one image from one table and 2 images from another table in a sequence.
    The first sequence/image is timed to close in the timer event.
    The second is to show the 2 images timed.
    In my seequence the second appears and do not wait for the first to finish.
    The first form is left behind and the second set is already running.
    I have tried xbasic_wait and tried to separate the two in separate functions.
    It doesd not wait.
    Attached is a sample with a main menu
    Attached Files

  • #2
    Re: Can not stop sequence of images displaying

    Try this.

    Code:
    dim picture1 as C = "xqx"
    dim picture2 as C = "xqx"
    dim picture3 as C = "xqx"
    tbl = table.open("t_title")
    pic1 = tbl.imagetitle
    tbl.close()
    pic1 = left(filename_from_alias(substr(pic1,18)),-1)
    
    tbl = table.open("t_show")
    for qx = 2 to 3
    eval("pic"+alltrim(str(qx))) = tbl.imagetitle
    tbl.fetch_next()
    next qx
    tbl.close()
    pic2 = left(filename_from_alias(substr(pic2,18)),-1)
    pic3 = left(filename_from_alias(substr(pic3,18)),-1)
    
    dlg_body = "{lf};"
    dlg_body = dlg_body + "{image="+picture1+"}  ;"
    dlg_body = dlg_body + "{lf};"
    dlg_body = strtran(dlg_body,var->picture1,unquote(var->pic1))
    
    ui_modeless_dlg_box("First",dlg_body)
    ui_yield()
    sleep(3)
    UI_MODELESS_DLG_CLOSE("First")
    
    dlg_body = "{lf};"
    dlg_body = dlg_body + "{image="+picture1+"}  ;"
    dlg_body = dlg_body + "{lf};"
    dlg_body = strtran(dlg_body,var->picture2,unquote(var->pic2))
    
    ui_modeless_dlg_box("Second",dlg_body)
    ui_yield()
    sleep(3)
    UI_MODELESS_DLG_CLOSE("Second")
    
    dlg_body = "{lf};"
    dlg_body = dlg_body + "{image="+picture3+"}  ;"
    dlg_body = dlg_body + "{lf};"
    dlg_body = strtran(dlg_body,var->picture3,unquote(var->pic3))
    
    ui_modeless_dlg_box("Third",dlg_body)
    ui_yield()
    sleep(3)
    UI_MODELESS_DLG_CLOSE("Third")
    There can be only one.

    Comment


    • #3
      Re: Can not stop sequence of images displaying

      Stan I just tried your code, fantastic! Not only does what I want but shows a sample of image manipulation that I was missing.
      I am going to try and see if I can convert your code for the situation of unknown No of pictures in the tshow table. Let me see if I can do it. If I can not I will come back for more assistance.

      Comment


      • #4
        Re: Can not stop sequence of images displaying

        If you get stuck. You should try it yourself first.

        script.txt

        Which leads to a slideshow creator, no frills like scaling the images though.

        Code:
        tst  = UI_GET_FILES_MULTIPLE( "Choose images" ,"R:","Jpeg (*.jpg)" )
        
        pic_count = w_count(tst,crlf())
        
        for tqx =  1 to pic_count
        	evaluate_template("dim picture"+alltrim(str(tqx))+" as C = \"xqx\"")
        	eval("pic"+alltrim(str(tqx))) = word(tst,tqx,crlf())
        next tqx
        
        for qzx = 1 to tqx
        	filename = eval("pic"+alltrim(str(qzx)))
        	if file.exists(unquote(filename))
        		title = "Picture "+alltrim(str(qzx))
        		dlg_body = "{lf};"
        		dlg_body = dlg_body + "{image="+eval("var->picture"+alltrim(str(qzx)))+"}  ;"
        		dlg_body = dlg_body + "{lf};"
        		dlg_body = strtran(dlg_body,eval("var->picture"+alltrim(str(qzx))),unquote(eval("var->pic"+alltrim(str(qzx)))))
        		
        		ui_modeless_dlg_box(title,dlg_body)
        		ui_yield()
        		sleep(3)
        		UI_MODELESS_DLG_CLOSE(title)
        	end if
        next qzx
        Last edited by Stan Mathews; 11-01-2013, 03:10 PM.
        There can be only one.

        Comment


        • #5
          Re: Can not stop sequence of images displaying

          Slideshow, all images scaled to 50% original size.

          Code:
          tst  = UI_GET_FILES_MULTIPLE( "Choose images" ,"R:","Jpeg (*.jpg)" )
          resized = ""
          
          tempdir = "C:\\"+"alphatemppic"
          dir_create_recurse(tempdir)
          for each foo in tst
          	filname = file.filename_parse(foo.value,"N")
          	filext = file.filename_parse(foo.value,"E")
          	pResult = a5_runImageMagicCommand(foo.value ,tempdir+chr(92)+filname+"_resz"+filext , "-resize 50% " )
          	if (.not. pResult.hasError) ' .F. if ok
          		resized = resized + tempdir+chr(92)+filname+"_resz"+filext +crlf()
          	end if
          next
          
          
          pic_count = w_count(var->resized,crlf())
          
          for tqx =  1 to pic_count
          	evaluate_template("dim picture"+alltrim(str(tqx))+" as C = \"xqx\"")
          	eval("pic"+alltrim(str(tqx))) = word(var->resized,tqx,crlf())
          next tqx
          
          for qzx = 1 to tqx
          	filename = eval("pic"+alltrim(str(qzx)))
          	if file.exists(unquote(filename))
          		title = "Picture "+alltrim(str(qzx))
          		dlg_body = "{lf};"
          		dlg_body = dlg_body + "{image="+eval("var->picture"+alltrim(str(qzx)))+"}  ;"
          		dlg_body = dlg_body + "{lf};"
          		dlg_body = strtran(dlg_body,eval("var->picture"+alltrim(str(qzx))),unquote(eval("var->pic"+alltrim(str(qzx)))))
          		
          		ui_modeless_dlg_box(title,dlg_body)
          		ui_yield()
          		sleep(3)
          		UI_MODELESS_DLG_CLOSE(title)
          	end if
          next qzx
          
          'will get a warning when the next line executes
          dir_remove_recurse(tempdir,.F.)
          'can suppress the warning if this is used instead
          'will get a warning when the next line executes
          'dir_remove_recurse(tempdir,.T.)
          There can be only one.

          Comment


          • #6
            Re: Can not stop sequence of images displaying

            Thanks Stan. What I was trying to implement is not to have to pick them , but to open the table t_show and read the files, something like This code below that was my begining and does not work yet as the assigning of the pictures in the file has not been set.
            The reason I am trying to use the table is because:
            1- I need to eliminate the picking. the table is created already.
            In the case you have shown, I was going to eliminate the form timing, as it now controlled by the script.
            2- Use the form created to display the images. The images comes from 2 tables. (1 has the start and end pictures & table 2 the actual images for the slideshow.

            Attached is my revised version, up to the moment with your codes and a button label PlayAll and Playall2 that did it, rather crude and laborious, but I was not able to close table 2. I would love to make your code work, opening the forms, instead of dialog boxes.


            tbl = table.open("t_show")
            tbl.fetch_first()
            while .not. tbl.fetch_eof()
            '-------------------------------------
            evaluate_template("dim picture"+alltrim(str(tqx))+" as C = \"xqx\"")
            eval("pic"+alltrim(str(tqx))) = word(tst,tqx,crlf())

            '===============
            filename = eval("pic"+alltrim(str(qzx)))
            if file.exists(unquote(filename))
            title = "Picture "+alltrim(str(qzx))
            dlg_body = "{lf};"
            dlg_body = dlg_body + "{image="+eval("var->picture"+alltrim(str(qzx)))+"} ;"
            dlg_body = dlg_body + "{lf};"
            dlg_body = strtran(dlg_body,eval("var->picture"+alltrim(str(qzx))),unquote(eval("var->pic"+alltrim(str(qzx)))))

            ui_modeless_dlg_box(title,dlg_body)
            ui_yield()
            sleep(3)
            UI_MODELESS_DLG_CLOSE(title)
            end if

            '==============
            tbl.fetch_next()
            end while
            tbl.close()
            Attached Files

            Comment


            • #7
              Re: Can not stop sequence of images displaying

              I have a working script for displaying however many images are available in t_show. It is in the attachment script.ext on post #4. The other code was just for fun.


              I was not able to close table 2. I would love to make your code work, opening the forms, instead of dialog boxes.
              Precisely the reason I used xdialog instead of forms. Less cleanup.
              There can be only one.

              Comment


              • #8
                Re: Can not stop sequence of images displaying

                I did not open that link. I did, very nice.
                One question, how can you make the size of the dialog full screen or alter the size of the box.
                I tried to change the 18 or -1 and it makes a tiny box.

                Comment


                • #9
                  Re: Can not stop sequence of images displaying

                  The 18 and the -1 have nothing to do with the dialog size. They extract the file name from the field contents

                  =filename_decode("somepath\imagename.ext")

                  Don't know anything about resizing.
                  There can be only one.

                  Comment


                  • #10
                    Re: Can not stop sequence of images displaying

                    Was looking in the wrong place. You can use

                    UI_DLG_MAXIMIZE(title)

                    after each

                    ui_modeless_dlg_box(title,dlg_body)
                    There can be only one.

                    Comment


                    • #11
                      Re: Can not stop sequence of images displaying

                      So far so good. yes the UI_DLG_MAXIMIZE(title) does fill the screen.
                      I found a very weird behavior in the script from the text file.

                      If you run it once it works perfectly, run the second time and you get the error
                      filename = eval("pic"+alltrim(str(qzx)))
                      varaible "pic2" not found

                      Exit, comeback and it works perfect, run it again and you get the error.
                      Any ideas?

                      Comment


                      • #12
                        Re: Can not stop sequence of images displaying

                        The code should be

                        tbl = table.open("t_show")
                        tbl.fetch_first()
                        qx = 2
                        while .not. tbl.fetch_eof()
                        eval("pic"+alltrim(str(qx))) = tbl.imagetitle
                        tbl.fetch_next()
                        qx = qx + 1
                        end while
                        tbl.close()
                        There can be only one.

                        Comment


                        • #13
                          Re: Can not stop sequence of images displaying

                          Thanks for all the attention Stan, I did apply the new line. Some how the program hangs and do display even the first picture.
                          Without the new line, goes back to the prior error.
                          Here is the code I am using
                          tbl = table.open("t_title")
                          pic1 = tbl.imagetitle
                          tbl.close()
                          pic1 = left(filename_from_alias(substr(pic1,18)),-1)

                          tbl = table.open("t_show")
                          qx = 2
                          while .not. tbl.fetch_eof()
                          ' tbl.fetch_first()
                          eval("pic"+alltrim(str(qx))) = tbl.imagetitle
                          tbl.fetch_next()
                          qx = qx + 1
                          end while
                          tbl.close()
                          for tqx = 1 to qx
                          evaluate_template("dim picture"+alltrim(str(tqx))+" as C = \"xqx\"")
                          next tqx

                          for qz = 2 to qx - 1
                          eval("pic"+alltrim(str(qz))) = left(filename_from_alias(substr(eval("pic"+alltrim(str(qz))),18)),-1)
                          next qz

                          dlg_body = "{lf};"
                          dlg_body = dlg_body + "{image="+var->picture1+"} ;"
                          dlg_body = dlg_body + "{lf};"
                          dlg_body = strtran(dlg_body,var->picture1,unquote(var->pic1))

                          ui_modeless_dlg_box("First",dlg_body)
                          UI_DLG_MAXIMIZE("First") ' it works....

                          ui_yield()
                          sleep(3)
                          UI_MODELESS_DLG_CLOSE("First")
                          for qzx = 2 to qz
                          filename = eval("pic"+alltrim(str(qzx)))
                          if file.exists(unquote(filename))
                          title = "Picture "+alltrim(str(qzx))
                          dlg_body = "{lf};"
                          dlg_body = dlg_body + "{image="+eval("var->picture"+alltrim(str(qzx)))+"} ;"
                          dlg_body = dlg_body + "{lf};"
                          dlg_body = strtran(dlg_body,eval("var->picture"+alltrim(str(qzx))),unquote(eval("var->pic"+alltrim(str(qzx)))))

                          ui_modeless_dlg_box(title,dlg_body)
                          UI_DLG_MAXIMIZE(title) ' not seen yet....

                          ui_yield()
                          sleep(3)
                          UI_MODELESS_DLG_CLOSE(title)
                          end if
                          next qzx

                          Comment


                          • #14
                            Re: Can not stop sequence of images displaying

                            That's not the code I posted. Should be

                            tbl = table.open("t_show")

                            tbl.fetch_first()
                            qx = 2
                            while .not. tbl.fetch_eof()
                            eval("pic"+alltrim(str(qx))) = tbl.imagetitle
                            tbl.fetch_next()
                            qx = qx + 1
                            end while
                            tbl.close()
                            There can be only one.

                            Comment


                            • #15
                              Re: Can not stop sequence of images displaying

                              Thanks for the perseverance Stan, Yes is working!!!!!!

                              Comment

                              Working...
                              X