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

UDF Parameters lookup

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

    #16
    Re: UDF Parameters lookup

    Hi Cal,
    Well, I mentioned it and so did put together a small example of how it works.

    First the functions have to be compiled into an AEX and added to the Alpha install directory in the addins_installed folder or added to the database Library--either way. I supplied an AEX file of these here too which I believe can be used--remove the .zip extension, leaving the AEX extension (Had to add the .zip in order to upload the file). Try it and let me know.

    The zip file is the sample db which has the functions. Using the interactive window to check them out the Help_Function() has to be brought up first and ran. Then the Function_Parameters() can be used.

    I am hoping someone will come up with a better way of having the addin functionality become usable (IOW without having to run the Help_Function).





    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #17
      Re: UDF Parameters lookup

      It's getting rather late tonight so I will check out your example in detail later. However, I'm curious about the need to put it in an aex file. I did my testing using a script. I never even saved it; just typed the code and ran it with the lightning bolt icon. I also tested a couple times with it in the autoexec. Either way seemed to work fine.

      One thing I did find was that I couldn't overwrite it. Once a particular 'help' had been created, the only way to undo it was to close A5 and start again with a clean slate.

      Comment


        #18
        Re: UDF Parameters lookup

        If you are simply using Alpha's built-in names in order to supply the function with the drop down lists, then no need to use AEX...but when creating my own arguments that do not rely upon Alpha's built in ones, then I cannot seem to get them to work without adding them to either a Library or the addins_installed folder.

        If you can somehow get my sample to work without adding them to the Library or addins_installed folder, then for sure let me know!!

        And correct about restarting Alpha--for some things you can just close the db and reopen...but when I am using parts that need the Addins_installed folder then the only way Alpha can see changes is to close Alpha down as it only loads the AEX / Addins_folder on startup I believe.
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment


          #19
          Re: UDF Parameters lookup

          Hi Mike, Cal

          Originally posted by MikeC View Post
          And correct about restarting Alpha--for some things you can just close the db and reopen...but when I am using parts that need the Addins_installed folder then the only way Alpha can see changes is to close Alpha down as it only loads the AEX / Addins_folder on startup I believe.
          Gee, closing and restarting Alpha Five back to where you were just happens to be a feature of the CSDA Code Utility ! ;)

          As for reloading the addins AEX, if you have only 1 copy of Alpha Five open, you can do it by XBasic (not as easy as it should be), or by just going to the Addin Manager and making a change (such as deleting one and clicking OK, and then repeating and adding one back in). If the file timestamp of the Addin_Library.AEX does not change, it didn't happen, so it's easy to verify.

          One might ask, though, that unless you are distributing library of functions, this might be a huge waste of time from those that might use it, and is it really worth the time?

          One tip, is that you can include the help code in the main function itself, and keep the help code with the main function that way. Then call the function with a parameter setting that implies initialization and runs the addins help code, but wouldn't normally be used otherwise. I always have an option for my functions that also closes modeless dialog and similar left over objects so that I can also cleanup without it being in a separate function.

          Keeping the initialization and closeout code with the operational code keeps it more consistent between versions.
          Regards,

          Ira J. Perlow
          Computer Systems Design


          CSDA A5 Products
          New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
          CSDA Barcode Functions

          CSDA Code Utility
          CSDA Screen Capture


          Comment


            #20
            Re: UDF Parameters lookup

            Hi Ira,
            Then call the function with a parameter setting that implies initialization and runs the addins help code, but wouldn't normally be used otherwise.
            I have tried just having the addins...help code inside the function but does not seem to run upon the initial use of the function when the arguments are to be set by a user. Is there something I have to do to make the addins run when first calling the function up say in the interactive editor or an event that will allow the users to tap into the functionality I have built in to the function (not Alpha's built in arguments--they work right away)??

            Regarding other points---this function is possibly going to be used on various user machines in which it has to stand on its own with no "setup" or additions made other than maybe the one time addition to the Library or addins_installed folder of an AEX of the function.
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


              #21
              Re: UDF Parameters lookup

              Originally posted by MikeC View Post
              I have tried just having the addins...help code inside the function but does not seem to run upon the initial use of the function when the arguments are to be set by a user. Is there something I have to do to make the addins run when first calling the function up say in the interactive editor or an event that will allow the users to tap into the functionality I have built in to the function (not Alpha's built in arguments--they work right away)??
              You still have to run the addin.function_argument_help() prior to it's use. That means the initialization call to the function must be in the Autoexec or similar to be automatically started. One partial solution is to set a global (or possibly an addins scoped variable) flag to indicate you've initialized. If the flag is not set, then any call to the function should initialize the addin help and set the flag, so the 2nd time around, it will work. It makes it easier for the debugging process too!

              Originally posted by MikeC View Post
              Regarding other points---this function is possibly going to be used on various user machines in which it has to stand on its own with no "setup" or additions made other than maybe the one time addition to the Library or addins_installed folder of an AEX of the function.
              Do you mean you have no documentation? That's one of the reasons's I tell people how to call my functions with a help flag that brings's up a dialog of text that has the function's current (and up-to-date!) help. e.g. for the CSDA Code Utility's functions
              a5desktop("H")
              codetimer("","H")
              DatabaseSave("","","H")
              libmake("","H")
              Each of the above will return the help info. So the documentation to use a function is actually a simple description to call the above help. And if you do something like a
              save_to_file(a5desktop("H"),"C:\a5desktophelp.txt")
              it will store the returned text (the same as the displayed value) and place it in the file.

              All of that text is inside the function, and I normally leave it in an unencrypted section so that it is available to read with file dumps, should somebody forget it's access method.
              Regards,

              Ira J. Perlow
              Computer Systems Design


              CSDA A5 Products
              New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
              CSDA Barcode Functions

              CSDA Code Utility
              CSDA Screen Capture


              Comment


                #22
                Re: UDF Parameters lookup

                You still have to run the addin.function_argument_help() prior to it's use.
                That is what I have found....and so instead of having to call the function twice, I will have instructions to first run the Help_Function (which contains only the addin.function_argument_help() functions needed) just prior to using the actual function that does the work--this way a user would stay on the same page/form and be able to use the function with the added functionality I have given it (drop-down lists, filter builder, order builder, etc.).

                I know an autoexec also works and if this function was part of an application then it would be a no-brainer! But this function is in place of creating a user interface in which to give parameters to the SimpleChart ActiveX object which enables a user to not to have to use xbasic to use it. IOW, once the parameters are placed in the function, a bar, line, or pie chart will be produced based on these parameters. SimpleChart has a small UI for setting the font, color, legend properties, etc. so is separate from the function.

                So far it works but have not tested it completely--and so far have just used it for Bar charts but will be a simple matter to have it produce the Line and Pie types when the Bar type works.

                I kinda doubt if this function would be something actual Alpha programmer would want as SimpleChartLite is just that...very simple...and very Lite!

                I will using this mostly, I think, with users of QRB who have no knowledge of Alpha or xbasic but yet want some simple charting capabilities.

                Hard to believe Alpha created a fantastic reporting tool (QReportBuilder) WITHOUT charting/graphing capabilities that have a user interface or even just a function that even a 2+ year novice like myself can write!!


                Note--I mentioned before about adding an argument with a static drop-down list....was not hard to do at all--don't know if I am just getting familiar with how these addin helps work or if it was just easy.
                Mike
                __________________________________________
                It is only when we forget all our learning that we begin to know.
                It's not what you look at that matters, it's what you see.
                Henry David Thoreau
                __________________________________________



                Comment


                  #23
                  Re: UDF Parameters lookup

                  Hi Mike, Cal, Steve et al,

                  Originally posted by MikeC View Post
                  As Ira indicated, if you use the same argument name as an existing Alpha function, your UDF will utilize the same feature as Alpha's. You can be more descriptive also in that say the Alpha argument is "tablename". If you name your argument "First_tablename", "Last_tablename" or whatever prefix you want with an underscore in front it will use the Alpha argument's feature, in this case, of course, a crlf list of all the tables in the database.
                  Actually, based on recent testing, the help prompt happens if the Alpha parameter name is contained anywhere within the name of your parameter.

                  I believe the earliest help parameter name found in the sequence of creating the help (whether yours or Alpha's) that is contained in your parameter name text will be the one executed. Thus, you need to really make sure the name is very unique from ones used by Alpha. Larger names should be executed before smaller names that are contained within the larger names.

                  Some currently being used/created by Alpha include
                  filename
                  file_open_mode
                  file_attribute

                  tablename
                  table_name
                  tablename_with_path
                  table_open_mode

                  fieldname

                  setname

                  data_dictionary_name

                  form_name
                  browse_name
                  report_name
                  letter_name
                  label_name
                  layoutname

                  operationname
                  toolbarname
                  menuname

                  number_format
                  time_format
                  date_format
                  filefindformat
                  saveas_format
                  keylist_format
                  format
                  custom_date_format
                  color_format
                  clipboard_format
                  dialog_format

                  regex_type
                  regex_syntax

                  result_expression

                  xdialog_name
                  script_name

                  system_mode
                  system_setting

                  systemfontname
                  font

                  tagname
                  type_of_operation
                  ui_beep_style
                  box_style
                  box_border
                  shadow_style
                  menu_context

                  matchtype
                  ascii_value
                  zipfilename
                  target_file
                  object_enum_flags
                  progid
                  SQLConnectionString
                  There probably are quite a few that I've missed, but those are probably the key ones.
                  Regards,

                  Ira J. Perlow
                  Computer Systems Design


                  CSDA A5 Products
                  New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                  CSDA Barcode Functions

                  CSDA Code Utility
                  CSDA Screen Capture


                  Comment


                    #24
                    Re: UDF Parameters lookup

                    Thanks for this Ira, That is a very useful list.

                    Cheers.
                    Tim Kiebert
                    Eagle Creek Citrus
                    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                    Comment


                      #25
                      Re: UDF Parameters lookup

                      Hi Mike, Cal,

                      At times the addin argument help shows the 3rd line saying something like
                      Press control-down key or click right click to select xxxxxxxx. When this appears, the parameter help appears upon activating it. However, for some of the parameter help, it does not work until I actually put an argument value in, as in "" or "A", and the 3rd line still does not appear, although it works at that point by pressing control-down.

                      Thus functionname(,"" works, but functionname(, does not.

                      Have you seen this behavior and/or know why it happens?

                      Thanks!
                      Regards,

                      Ira J. Perlow
                      Computer Systems Design


                      CSDA A5 Products
                      New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                      CSDA Barcode Functions

                      CSDA Code Utility
                      CSDA Screen Capture


                      Comment


                        #26
                        Re: UDF Parameters lookup

                        Ira,
                        Once I added the function/addin.function_argument_help() function to the addins_installed folder or imported it to the database code library (as an AEX) on Cal's suggestion, the extra text help you refer to has always appeared right away....otherwise was very inconsistent. Also note (for others mostly) that the second argument of the addin.function_argument_help() is called a description and is what it placed in the extra text after Alpha's generic "Press control-down key or right click to select".

                        As to why it happens....only guess is that this internal function we're using has to be initialized when Alpha starts.

                        Also that since part of the extra help text is dependent upon what is placed in the addin.function_argument_help() function, it won't appear until it is being used?? :)
                        Mike
                        __________________________________________
                        It is only when we forget all our learning that we begin to know.
                        It's not what you look at that matters, it's what you see.
                        Henry David Thoreau
                        __________________________________________



                        Comment


                          #27
                          Re: UDF Parameters lookup

                          Hi Mike, Cal,

                          I finally figured out why I was experiencing the issue. Once I did this, it works reliably with my functions. You do not have to compile an AEX, it works fine with regular functions.

                          It turns out the answer was right in front of my eyes, but I did not see!

                          If you use %lastvalue% in the help, and you have no value in the current parameter, then you need to define a 2nd line that does it without the %lastvalue% in it. An example was in the sample code like this;

                          Code:
                          addin.function_argument_help( "file_attribute" , "file find attributes", "a5_fileattribute_helper('%lastvalue%')" , "=" , "" )
                          'create two version. if there is no existing value when user right clicks, bubble help will use the following def.
                          addin.function_argument_help( "file_attribute" , "file find attributes", "a5_fileattribute_helper()" , "=" , "" )
                          I suspect Alpha processes all lines containing the parameter name text until it gets to the 1st line (as executed from start) it can evaluate without error.

                          I believe I now understand the full scope of using this, even though I still think's it's a kludge.
                          Regards,

                          Ira J. Perlow
                          Computer Systems Design


                          CSDA A5 Products
                          New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                          CSDA Barcode Functions

                          CSDA Code Utility
                          CSDA Screen Capture


                          Comment


                            #28
                            Re: UDF Parameters lookup

                            Thanks Ira,
                            Nice to have a few others involved in figuring out the undocumented areas of Alpha--especially an unsupported one such as this!

                            Have you found the best place to initially place the addin.function_argument_help() ? Unless I run it manually by either highlighting the actual addin....help function or by running a function that contains these addin....helps, the function I want to use will not have all the arguments working. And I have to do this each time I want to run this function. An autoexec works, but am looking for a way to do it without this for this particular situation.
                            Mike
                            __________________________________________
                            It is only when we forget all our learning that we begin to know.
                            It's not what you look at that matters, it's what you see.
                            Henry David Thoreau
                            __________________________________________



                            Comment


                              #29
                              Re: UDF Parameters lookup

                              Hi Mike,

                              I found that the addin help exists until you close Alpha Five. Closing the database has no effect on the addin help after you open a new database.

                              Originally posted by MikeC View Post
                              Have you found the best place to initially place the addin.function_argument_help() ? Unless I run it manually by either highlighting the actual addin....help function or by running a function that contains these addin....helps, the function I want to use will not have all the arguments working. And I have to do this each time I want to run this function. An autoexec works, but am looking for a way to do it without this for this particular situation.
                              Running the addin help lines occurs within my functions themselves. The 1st time I run the function (for any reason), it initializes this help, so the 2nd time it's there. How is this helpful? Almost every function I have has a way to return the version # of the function without any User Interface displays. This can be as easy as adding an extra parameter at the end of the parameters of the function, or including it as a particular setting of your current parameters' set of arguments to return this value (or at least do nothing).

                              I then put a call to each function's version return in the autoexec, forcing the initialization. It doesn't preclude this initialization need, but at least now the support for the function is included within the function itself, and thus tracks the changes.

                              You could also include a single script or function to initialize all the help in a Library or AEX, allowing the user to just add one simple line, eg. MyLibrary_Init()
                              to the autoexec. This at least simplifies it a bit.

                              My kind of wish list request I made years ago was to execute an Autoexec if it existed from each addin library AEX during bootup. This would allow libraries to properly setup themselves at boot time, without having to explicitly code them in.
                              Last edited by csda1; 10-08-2008, 08:44 AM.
                              Regards,

                              Ira J. Perlow
                              Computer Systems Design


                              CSDA A5 Products
                              New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                              CSDA Barcode Functions

                              CSDA Code Utility
                              CSDA Screen Capture


                              Comment


                                #30
                                Re: UDF Parameters lookup

                                Ira,
                                Not good news but now I know that the possibility is almost null regarding automatic initialization and won't pursue it much more.

                                My kind of wish list request I made years ago was to execute an Autoexec if it existed from each addin library AEX during bootup. This would allow libraries to properly setup themselves at boot time, without having to explicitly code them in.
                                I would go even further to want it processed without anything done by the developer including the addition of an autoexec--have another autoexec type file that Alpha runs when there are addins in the library or addins_installed folder.



                                Thanks again Ira for your time on this---learned a few things and it reinforced many others that I was somewhat unsure about having discovered them on my own.
                                Mike
                                __________________________________________
                                It is only when we forget all our learning that we begin to know.
                                It's not what you look at that matters, it's what you see.
                                Henry David Thoreau
                                __________________________________________



                                Comment

                                Working...
                                X