Alpha Video Training
Results 1 to 11 of 11

Thread: UDFs in WAS

  1. #1
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default UDFs in WAS

    OK, I'm probably missing something really simple here but I can't figure it out.

    I have an app that was working fine in the beta version but now it can't see my User Defined Functions unless I put the functions in each a5w page. This rather defeats the purpose of defining a global function.

    Anybody know what I have to do to make a UDF "visible" to all a5w pages?

    If it helps any: I have no idea what I did in the beta version that was making this work. The a5w pages are identical. The only thing I can think of that is different is that there was no Projects file in the last beta version I ran this in.

  2. #2
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default RE: UDFs in WAS

    I have only used a UDF in WAS without any projects and I had it included at the end of my a5w page after the close body and html tags:

    %A5
    a5w_include("func\webpage.a5w")
    %

    My access_links file accessed the UDF and displayed the results ... the results were displayed on my main page which is where I have the above include.

    If you are trying to access your UDF from the projects somewhere, there may be a different way to handle them.

  3. #3
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,172

    Default RE: UDFs in WAS

    Cal

    A user function can be used on a WAS either by ading it to the page or putting the function in an aex file in the addins_installed program folder. A WAS page can not access a function saved in the database. Since opening a WAS page only requires that the server be running, it is possible to have one databse open in A5V6 and have pages accessing tables in another database. In fact, you don't even need to open a database in V6 with the WAS server running.

    Jerry

  4. #4
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default RE: UDFs in WAS

    Jerry,

    ""putting the function in an aex file in the addins_installed program folder""

    If you do this, is the function call the same as if you placed it on the a5w page? If not, what is the difference?

    Thanks
    Cheryl

  5. #5
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default RE: UDFs in WAS

    Thanks Jerry. Unfortunately, now I'm really confused - but that isn't your fault.

    I did nothing and today it's working. Well, almost nothing....

    My machine didn't close down last night because of a hanging A5 session that had nothing to do with the WAS session. This morning I cancelled the shutdown and killed the other A5 session. Now it's working again. I suspect that session was somehow preventing my aex files from loading properly.

    Cheryl - Yes, the functions become global functions that can be used from any page without loading them in the specific a5w page. I'm pretty sure the same applies to scripts saved in the aex files - at least it does for regular desktop apps. I have all kinds of stuff that I do this way; some for apps and some just for development issues - Phone_dash(), Verify_email(), Compact_tables(), Copy_deleted()(), Check_century(), Data_path(), Script_list_by_date(), Layout_script_passwords(), Scp_passwords(), Undelete_choices(), Index_set_verify()[Like Index_SetExplicit but used with tables], Fix_future_date(), Check_date(), LoadForm(), Del_dollar(), Check_caps, Std_OnKey, Save_and_close, and, of course, my
    AIMS_backup routines and my soon-to-be-released AIMS_App_Analyzer.

    Cal Locklin
    www.aimsdc.net

  6. #6
    Alpha Software Employee AaronBBrown's Avatar
    Real Name
    Aaron Brown
    Join Date
    Feb 2001
    Location
    Waltham, MA
    Posts
    2,836

    Default RE: UDFs in WAS

    Put the UDF in a database.
    Compile the database to an AEX file.
    Add the AEX file as an addin to your addins_installed folder.
    Restart Alpha Five.
    Call the function just as you would any other function.

  7. #7
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,172

    Default RE: UDFs in WAS

    Cal

    The aex file can run functions and scripts just as if they were local. If the aex file is in the addins_installed, you can call them on a web page just like any A5 function.

    Jerry

  8. #8
    VAR Howard G. Cornett's Avatar
    Real Name
    Howard Cornett
    Join Date
    Feb 2003
    Location
    Lexington, MA
    Posts
    666

    Default RE: UDFs in WAS

    How do you do this if you only have the new Web App Server shell running and not the full version? Where do you create the Addins_Installed folder so it works?

    Howard

  9. #9
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,695

    Default RE: UDFs in WAS

    You would create addins_installed under wherever you installed the server-only program files.

    Alternatively you can use the a5w_include() method mentioned by Cheryl above. This technique is useful if you do not have direct control over the server, such as if you are hosting with an ISP.

    -Lenny

  10. #10
    VAR Howard G. Cornett's Avatar
    Real Name
    Howard Cornett
    Join Date
    Feb 2003
    Location
    Lexington, MA
    Posts
    666

    Default RE: UDFs in WAS

    Lenny,

    OK, I got that solved, but no style sheets load with the server-only app. How and where do I load the style sheets?

    Howard

  11. #11
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,695

    Default RE: UDFs in WAS

    The server does nto need the style sheets installed - when you publish an app to the server it will also publish the required style sheet(s)

    -Lenny

Similar Threads

  1. Delete Script Files and UDFs
    By Mike Thomson in forum Alpha Five Version 6
    Replies: 3
    Last Post: 10-04-2005, 07:06 PM
  2. Now UDFs in default value?
    By CALocklin in forum Alpha Five Version 6
    Replies: 16
    Last Post: 02-19-2005, 12:40 PM
  3. Bubble Help For UDFs
    By Blake in forum Alpha Five Version 5
    Replies: 11
    Last Post: 04-09-2003, 09:28 PM
  4. where are UDFs stored?
    By Greg Fong in forum Alpha Five Version 4
    Replies: 1
    Last Post: 09-15-2002, 08:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •