PDA

View Full Version : UDFs in WAS


ABC123

CALocklin
08-23-2004, 10:04 PM
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.

Cheryl Lemire
08-23-2004, 10:48 PM
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.

JerryBrightbill
08-24-2004, 03:39 AM
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

Cheryl Lemire
08-24-2004, 03:53 AM
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

CALocklin
08-24-2004, 05:48 AM
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

AaronBBrown
08-24-2004, 06:24 AM
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.

JerryBrightbill
08-24-2004, 04:50 PM
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

Howard G. Cornett
02-11-2005, 09:16 AM
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

Lenny Forziati
02-11-2005, 09:31 AM
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

Howard G. Cornett
02-11-2005, 10:16 AM
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

Lenny Forziati
02-11-2005, 10:20 AM
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