|
|
| Author |
Message |
|
| seancharles |
Posted: Tue Aug 07, 2007 8:44 pm |
|
|
|
User
Joined: 18 Jul 2007
Posts: 57
|
Does anybody know if / how (even possible) to include files in the out(A) function ?
I am working on something and I have a bunch of records defined in a .hrl file and I need to be able to use them within a .yaws file.
Currently I have not found a way to be able to do this and it's maddening.
I read somewhere in the docs for yaws that you can fudge with the args record but for the life of me I can't find that section again.
So, can it be done and if so how ?
If I can't use yssi then I would have to write my own handlers etc but I want to use what yaws provides because it's probably more stable than anything I will ever produce.
Thanks,
Sean Charles. |
|
|
| Back to top |
|
| seancharles |
Posted: Tue Aug 07, 2007 9:09 pm |
|
|
|
User
Joined: 18 Jul 2007
Posts: 57
|
I just shot myself in the foot. The bad news is it was still in my mouth!
You *CAN* include files... it helps that you remember what is where and ensure that the include contains the correct path:
Code:
<erl>
-include("../modules/records.hrl").
out( A ) ->
{M,D} = controller:get_active_page(A),
Page = M#menuitem.page, % WORKS!!
:
: yada yada yada
:
</erl>
I will read THREE times before posting next time, almost as effective as Cardboard Programmer for solving problems!
Thanks yaws
 |
|
|
| Back to top |
|
| Mazen |
Posted: Wed Aug 08, 2007 8:08 am |
|
|
|
User
Joined: 20 Jul 2006
Posts: 164
Location: London
|
I Love when people answer their own questions. Makes me warm and fuzzy inside    |
|
|
| Back to top |
|
| martin |
Posted: Mon Aug 13, 2007 9:05 am |
|
|
|
User
Joined: 06 Aug 2006
Posts: 11
|
If you are unsure of the location of your modules and you use the normal OTP style applications, i.e. using the app/rel/boot stuff you can use -include_lib("myapp/include/myinclude.hrl"). where the version bit will be replaced with the currently booted version.
NOTE: A fullish path to the application needs to be provided if you use normal "erl" e.g. -pa ../../myapp-1.2.3/ebin or -include_lib/code:priv_dir etc. will not work |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|