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

ui_get_File NOT type

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

    ui_get_File NOT type

    Is it possible to use ui_get_file() to filter out file types? I do NOT want to include .dbf files. I could just filter by PDF|TXT|DOC, - but I'm afraid I'd leave a file type out.

    Thanks ~ Tom

    #2
    Hi Tom,

    I think I'm on the right track for what you want.
    The code below is designed to have the end user choose a spreadsheet.
    With just a few simple modifications, it should work the way you want.

    Hope this helps.

    Gregg
    Code:
    FUNCTION getaFile AS C ( )
    
    DIM SHARED response as c
    DIM SHARED varC_result as C
    texttospeech("Choose a file.")
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    varC_result = ui_dlg_box("Choose a file.",<<%dlg%
    {region}
    What file?:| [%p=ui_get_file("","Text(*.txt)|SpreadSheet(*.xls)|FudgeSheet(*.xlsx)|BingySheet(*.slk)",response,"X");I=$a5_smart_file%.40response];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%)
    '''debug(1)
    select
    case varC_result = "OK" .and. len(alltrim(remspecial(response)))>0
    getaFile=response
    case varC_result = "OK" .and. len(alltrim(remspecial(response)))=0
    getaFile = "No File Selected"
    case else
    getaFile = "Aborted"
    end select
    
    END FUNCTION
    Gregg
    https://paiza.io is a great site to test and share sql code

    Comment


      #3
      Hi Gregg,

      I'll give this a try in the morning.

      I don't see how it EXCLUDES a file type (dbf files). I think you're saying, just don't include that file type in the list. I can do that.

      ~ Tom

      Comment


        #4
        If you look at the options for file types, there are literally thousands, each specific to a type of application, or across applications.
        Without trying to be clever, I think you really need to manage the list on an inclusive not exclusive basis.
        Just sayin'
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        Apologies to anyone I haven't managed to upset yet.
        You are held in a queue and I will get to you soon.

        Comment


          #5
          Good advice Ted.

          I think I'll use file.exist(*.dbf) and if it does, move it to another folder.

          Thanks to all for taking a look and sharing your thoughts.

          ~ Tom

          Comment


            #6
            I wouldn't use ui_get_files(). I would make a list of unwanted extensions, collect the files in your desired folder and present only those for review in a dialog for actions (example in attached file).
            Attached Files
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #7
              Mike - I get an error message when trying to open your attachment: "Invalid File Specified"

              ~ Tom

              Comment


                #8
                I'll try and upload again. It is just a txt file. I didn't work. This new message board isn't very good, in fact it sucks. I can't upload a txt file. And the code I am giving you was all perfectly formatted but the Code delineators in this new message board doesn't incorporate the formatting. Very annoying!! . Here is the text in the file I tried to upload anyway.

                Code:
                dim vfldr as C="E:\URSA"+chr(92) ' <<<< change this to your folder address
                
                dim vLexclude as C=comma_to_crlf(".alb,.alm,.alx,.dbf,.ddd,.cdx,.abd,.ddm,.ddx,.fpt,.sem,.set,.sex")
                dim vprobe as C=vfldr+"*.*"
                dim vname_now as C=""
                dim vext_now as C
                dim vLext_name_a as C
                dim vLname_ext_a as C
                dim vLext_name_d as C
                dim vLname_ext_d as C
                dim vLfiles_show as C
                dim vn_sort_code as N=1
                dim vn_chr46 as N
                
                vfiles=filefind.get(vprobe,FILE_FIND_NOT_DIRECTORY)
                
                for each foo in vfiles
                vext_now=alltrim(file.filename_parse(foo,"E"))
                vname_now=alltrim(file.filename_parse(foo,"N"))
                if is_one_of(vext_now,vLexclude)=.f.
                vLext_name_a=vLext_name_a+vext_now+space(17-len(vext_now))+vname_now+crlf()
                vLname_ext_a=vLname_ext_a+vname_now+space(33-len(vname_now))+vext_now+crlf()
                end if
                next
                vLext_name_a=sortsubstr(vLext_name_a,crlf(),"A")
                vLext_name_d=sortsubstr(vLext_name_a,crlf(),"D")
                vLname_ext_a=sortsubstr(vLname_ext_a,crlf(),"A")
                vLname_ext_d=sortsubstr(vLname_ext_a,crlf(),"D")
                vLfiles_show=vLext_name_a
                
                'SHOW DIALOG
                
                'DIALOG STRUCTURE
                dim dlg_title as C
                dlg_title = "FILES"
                dim dlg_body as C
                dim dlg_code as C
                dim vR as C
                
                'dialog field variables
                
                'build dialog
                dlg_body = <<%dlg%
                {startup=init}{xmargin=3,3}{ymargin=1,1}
                
                {region1}{background=#210,190,210}{frame=1,1}{sp=63}<%T=File Open;B=T;I=$$file.open%4,1!file_open>{sp=3}<%T=Sort;B=T;I=$$sort%4,1!sort>
                {sp=3}<%T=Delete;B=T;I=$$edit.delete%4,1!delete>{sp=3}<%T=Close;B=T;I=$$generic.exit%4,1!exit>{text=2};
                {endregion1};{background=#243,233,119}
                
                {region2}{font=arial,8,bi}{frame=1,1: Frame2 }{font=Arial,10}{background=#243,233,119}
                {sp=3}{font=courier new,10,b}[.90,31vfile_pick^#vLfiles_show!evfk_*]{text=3};
                {endregion};{lf};
                %dlg%
                
                dlg_code=<<%code%
                'INIT
                IF a_dlg_button="init"
                sys_send_keys("{HOME}")
                a_dlg_button=""
                END IF
                
                'FILE PICK
                IF left(a_dlg_button,5)="evfk_"
                if a_dlg_button="evfk_change"
                if vn_sort_code=1 .or. vn_sort_code=2
                vext_now=alltrim(substr(vfile_pick,1,16))
                vname_now=alltrim(substr(vfile_pick,17,50))
                else
                vn_chr46=occurs(chr(46),vfile_pick)
                
                vname_now=alltrim(word(vfile_pick,1,chr(46),vn_chr46))
                vext_now=chr(46)+alltrim(word(vfile_pick,vn_chr46+1,chr(46)))
                end if
                end if
                a_dlg_button=""
                END IF
                
                'FILE OPEN
                IF a_dlg_button="file_open"
                sys_open(vfldr+vname_now+vext_now)
                a_dlg_button=""
                END IF
                
                'SORT
                IF a_dlg_button= "sort"
                dim vpstyle as C=comma_to_crlf("menu.v_item_min_leftx=0,color.menu_v_background=#250+240+152,color.menu_v_left=#200+85+85,color.menu_v_right=white,font.menu=Arial,10,b,color.font=menu_v_font")
                dim vpur as C
                dim vLway as C=comma_to_crlf("File Type Ascending,File Type Descending,Filename Ascending,Filename Descending")
                vpur=ui_popup_styled_menu(vLway,vpstyle)
                
                if vpur="File Type Ascending"
                vLfiles_show=vLext_name_a
                vn_sort_code=1
                else if vpur="File Type Descending"
                vLfiles_show=vLext_name_d
                vn_sort_code=2
                else if vpur="Filename Ascending"
                vLfiles_show=vLname_ext_a
                vn_sort_code=3
                else if vpur="Filename Descending"
                vLfiles_show=vLname_ext_d
                vn_sort_code=4
                end if
                
                ui_modeless_dlg_refresh("Files")
                a_dlg_button=""
                END IF
                
                'DELETE
                IF a_dlg_button="DELETE"
                if vfile_pick=""
                msgbox("A FILE SELECTION IS REQUIRED")
                GOTO ENDDELETE
                end if
                
                vconf=ui_msg_box("CONFIRM","Delete "+vname_now+vext_now+" now?",33)
                if vconf=1
                if file.exists(vfldr+vname_now+vext_now)
                file.remove(vfldr+vname_now+vext_now)
                if vn_sort_code=1
                vLext_name_a=word_subtract(vLext_name_a,vfile_pick,crlf())
                else if vn_sort_code=2
                vLext_name_d=word_subtract(vLext_name_d,vfile_pick,crlf())
                else if vn_sort_code=3
                vLname_ext_d=word_subtract(vLname_ext_a,vfile_pick,crlf())
                else if vn_sort_code=4
                vLname_ext_d=word_subtract(vLname_ext_d,vfile_pick,crlf())
                end if
                vLfiles_show=word_subtract(vLfiles_show,vfile_pick,crlf())
                else
                msgbox("The file "+vname_now+vext_now+" does not exists")
                end if
                end if
                ENDDELETE:
                a_dlg_button=""
                END IF
                
                'EXIT
                if a_dlg_button="exit"
                ui_modeless_dlg_close(dlg_title)
                end if
                
                %code%
                
                'GENERATE DIALOG
                vR=ui_dlg_box(dlg_title,dlg_body,dlg_code)
                if vR="Cancel"
                vproceed="no"
                end
                end if
                Last edited by Mike Wilson; 04-27-2020, 11:07 PM.
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                  #9
                  WOW!!! This represents a lot of work and genius thinking.

                  Thank you - I'll have to "go to school" on it to fully understand, but I'm sure it will be very helpful.

                  Thanks again,

                  ~ Tom

                  Comment

                  Working...
                  X