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

Some Useful Functions

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

    Some Useful Functions

    Attached is an aex of some useful functions compatible with A5v6 and above. The included Word document explains the functions.

    Delete_Temp_Files()
    Inf_Get_Available_Space(driveletter as C)
    Inf_Get_Drive_Format(driveletter as C)
    Inf_Get_Drive_Ready(driveletter as C)
    [Inf_Get_Drive_Type(driveletter as C)
    Inf_Get_Drives()
    Inf_Get_IP_Address()
    Inf_Get_Processor_Type()
    Inf_Get_Share_Names()
    Inf_Get_Volume_Serial(driveletter as C)
    Inf_MAC_Address_Detail()
    Is_Window_Open(windowname as C)
    SecondInst()
    User_A5_Version()
    Last edited by ChrisHawkes; 04-05-2009, 08:06 PM. Reason: Modified function inf_get_volume_serial() - now works as documented
    If It Works First Time, There's Something Wrong!!!

    #2
    Re: Some Useful Functions

    Hi Chris,
    How can one identify the physical MAC address from the list shown by the function Inf_MAC_Address_Detail(). It is important to identify the physical MAC address as it does not change over time except when the system board is changed which is rare in most cases. I am trying to write an xbasic script that will pickup the Physical MAC address from the function Inf_MAC_Address_Detail() list. The list returned by that function currently has MAC Address:-XX:XX:XX:XX:XX:XX Adapter Name:- for all the found MAC addresses. If the physical MAC address has the word Physical on it, it will be easy to use an xbasic script to identify it from the list. Please help Chris. I have emailed you before about this & other functions and my need for it.

    Rawlings.

    Comment


      #3
      Re: Some Useful Functions

      Rawlings

      I'll see what I can do.

      Chris
      If It Works First Time, There's Something Wrong!!!

      Comment


        #4
        Re: Some Useful Functions - Take 2

        Attached AEX file of my revised useful functions with some new functions added. The included Word document explains the functions. Tested on v6 thru v8 - v9 not tested.

        Delete_Temp_Files()
        Hostavailable_2(webaddress as C) NEW
        Inf_Get_Available_Space(driveletter as C)
        Inf_Get_Available_Space2(driveletter as C, divisor as C, decbin as C) NEW
        Inf_Get_Drive_Format(driveletter as C)
        Inf_Get_Drive_Ready(driveletter as C)
        Inf_Get_Drive_Type(driveletter as C)
        Inf_Get_Drives()
        Inf_Get_IP_Address()
        Inf_Get_IP_Address2() NEW
        Inf_Get_OSName() NEW
        Inf_Get_Processor_Type()
        Inf_Get_Proxy() NEW
        Inf_Get_Share_Names()
        Inf_Get_Volume_Serial(driveletter as C)
        Inf_MAC_Address_Detail()
        Inf_MAC_Address_Detail2() NEW
        Is_Window_Open(windowname as C)
        SecondInst()
        User_A5_Version()
        If It Works First Time, There's Something Wrong!!!

        Comment


          #5
          Re: Some Useful Functions

          Suggestion - create your aex file using the Compile_library() command and assign a "unique" slot/handle number. (There's no guarantee it will always be unique but right now there are very, very, very few people using this method so there isn't much concern for the near future.)

          The following "hint" is aimed primarily at building aex files but the concept of putting them only on the server applies to any developer that uses aex addin files as an integral part of their application.

          Building an aex file using Compile_library() with a specific slot number allows the aex file to be installed only on the server in a network situation. Then it can be loaded from the workstations by using the Load_library() command. The advantage of this method on a network becomes very clear very quickly the first time you need to install an update. If the aex file is in the Addins_installed folder then it has to be installed in the Addins_installed folder on every workstation - and it will have to be updated on every workstation. If it's only on the server and loaded with Load_library(), then it only needs to be updated on the server.

          Of course, this also requires the user to write some very complex xbasic (isn't all xbasic complex?) in the autoexec script to load the addin:
          DIM datapath as C
          IF a5.Get_Master_Path() = ""
          datapath = a5.Get_Path() + chr(92)
          ELSE
          datapath = a5.Get_Master_Path() + chr(92)
          END IF
          Load_library( datapath + "<addin_name>" )


          Why use a unique slot number?
          So you can use Load_library() on multiple aex files. If someone has my backup routine and wants to also load your Useful_functions_1a.aex, they can only do it if both were compiled with different slot numbers.

          Alpha uses slots 0, 100, 125, 126, and 127. (I used to know what each number was used for but can't find the list anymore.) I do know that any aex file built with the normal "built-in" routine will use slot 100. I'm using 60, 61, 62, and 63 for some of the addins I've been selling so it would be nice if yours started from another number.

          WARNING: If it is only loaded when needed - rather than in the autoexec, then you will need additional error routines to determine if it has already been loaded. Otherwise, a second attempt to load it will generate an error. In other words, I recommend keeping it simple and just putting it in the autoexec script. The load time is nearly instantaneous.

          ALSO NOTE: If the addin would only be used by a developer and not as part of an application, then it would be installed in the Addins_installed folder and there is no need to be concerned about the slot number. I take this into consideration when building my addins - the developer addins that would not end up being used as an integral part of an application are just built with the "standard" method and end up being assigned slot 100 because it doesn't matter.

          Comment


            #6
            Re: Some Useful Functions

            Cal

            Thanks for reminding me. Even though I use your 'Grab Bag' utilities, I seem to overlook this sometimes.

            Attached is the same AEX file except that it now uses slot 80

            P.S. The Developer Functions I posted the other day does have a slot no (76).
            Last edited by ChrisHawkes; 05-14-2009, 04:55 AM.
            If It Works First Time, There's Something Wrong!!!

            Comment


              #7
              Re: Some Useful Functions

              Hi Cal,

              Originally posted by CALocklin View Post
              Why use a unique slot number?
              So you can use Load_library() on multiple aex files. If someone has my backup routine and wants to also load your Useful_functions_1a.aex, they can only do it if both were compiled with different slot numbers.
              Actually, you can. There is an undocumented command COMBINE_LIBRARY() that will combine multiple libraries into 1 (I forget what happens if same type and name exist for entries in different input libraries, probably the 1st or last has precedence)

              Originally posted by CALocklin View Post
              Alpha uses slots 0, 100, 125, 126, and 127. (I used to know what each number was used for but can't find the list anymore.) I do know that any aex file built with the normal "built-in" routine will use slot 100. I'm using 60, 61, 62, and 63 for some of the addins I've been selling so it would be nice if yours started from another number.
              These are the ones I know of for Alpha Five products
              library #, purpose
              1 System.AEX
              100 Temporary for addin_manager explorer
              125 used in loading aex files
              126 used for aex with database name
              127 used for Addin_Library.Aex
              200 used by web server to load AEX libraries to a web page
              60->63 for AIMS products
              64 for CSDA Code Utility
              65-67 reserved for future CSDA products
              I don't believe Library 0 is used, however, I'd stay away from #'s 0, 128, 254 and 255, and numbers 2-7 as well.
              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


                #8
                Re: Some Useful Functions

                Originally posted by csda1 View Post
                Actually, you can. There is an undocumented command COMBINE_LIBRARY() that will combine multiple libraries into 1 (I forget what happens if same type and name exist for entries in different input libraries, probably the 1st or last has precedence)
                True. But then the developer has to combine them before loading the combined aex file. And, assuming they were combined before distributing the application, updating one aex file would then mean recreating the combined file. Depending on the number/variety of applications, it may become an issue trying to keep track of what was combined with what for each app.

                Of course, there will be more Load_library() routines in your autoexec if using multiple individual aex files.

                It can be done either way - people just need to be aware of the issues.

                For those who have my AIMS_Grab_Bag addon, you can get a list of all libraries used by your application by running the AEX_Libraries_in_use routine.

                And, I definitely agree with staying away from numbers 2-7. Here's the AEX_Libraries_in_use listing from one of my v9 apps. Note #2:
                1: C:\PROGS\a5v9\system.AEX
                2: C:\PROGS\a5v9\themes\modern.AEX
                60: E:\a5v9\Trak-It_SP\App\AIMS_Reg_client.AEX
                127: C:\Documents and Settings\Cal\Application Data\Alpha Software\Alpha Five Version 9\Installations\CPROGSa5v9\addin_library.AEX

                For the curious, I'm pretty sure the "addin_library.aex" is created with the Combine_Library() command that Ira mentioned. The "addin_library.aex" is a "system" library created by Alpha that combines all the aex files in your Addins_installed folders. The CSDA utility isn't shown because it's in the Addins_installed folder which means it's included in #127 - the "addin_library.aex".

                Comment


                  #9
                  Re: Some Useful Functions

                  Originally posted by CALocklin View Post
                  True. But then the developer has to combine them before loading the combined aex file. And, assuming they were combined before distributing the application, updating one aex file would then mean recreating the combined file. Depending on the number/variety of applications, it may become an issue trying to keep track of what was combined with what for each app.

                  Of course, there will be more Load_library() routines in your autoexec if using multiple individual aex files.
                  If you are going to use complex XBasic :), then you could get a list of all AEX's in the database directory, do a combine of them, and load that combined library. Alpha only load's the one with the same name as the database automatically.

                  Here's an update list of known library numbers
                  library #, purpose
                  0 Alpha5.AEX, Startup.AEX
                  1 System.AEX
                  2 modern.AEX
                  3 classic.AEX
                  100 Temporary for addin_manager explorer, and default compiled number
                  125 used in loading aex files
                  126 used for aex with database name
                  127 used for Addin_Library.Aex
                  200 used by web server to load AEX libraries to a web page
                  60-63 for AIMS product
                  64 for CSDA Code Utility
                  64 AlphaSports.AEX
                  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


                    #10
                    Re: Some Useful Functions

                    Originally posted by csda1 View Post
                    If you are going to use complex XBasic :), then you could get a list of all AEX's in the database directory, do a combine of them, and load that combined library. Alpha only load's the one with the same name as the database automatically.
                    Duhhh! For some reason I was thinking in terms of the developer combining something before distributing the application/update. That isn't necessary - just combine and load as one "routine" in the autoexec. I haven't actually tried it but it should be easy enough. Could even make it a completely generic script.

                    Comment

                    Working...
                    X