- Forum
- T24 Technical Discussions
- T24 Development & Customization
- How to call a subroutine from inside another ?
×
Discuss on Template programming, jBASE programming, Enquiries, No-File enquiry, Enquiry routines, Version, Version routines, Menus, Abbriviations, Creating local reference fields, Fast path enquiries, Creating charts and graphs, Generating Reports, Deal slips, Straight through processing, Multi Company and Multi Book setup, Tabbed screens, Composite Screens, T24 API, etc...
How to call a subroutine from inside another ?
- Moe_T24
- Topic Author
- Offline
- Senior Member
- T24 Technical
Less
More
- Posts: 57
- Thank you received: 1
7 years 11 months ago #19334
by Moe_T24
Best Regards
How to call a subroutine from inside another ? was created by Moe_T24
Hello ,
How can I call a subroutine from inside another subroutine? Should $INCLUDE be used to imoirt it. Where should the subroutine exist ?
Thanks .
How can I call a subroutine from inside another subroutine? Should $INCLUDE be used to imoirt it. Where should the subroutine exist ?
Thanks .
Best Regards
Please Log in or Create an account to join the conversation.
- mrul3s
- Offline
- User is blocked
Less
More
- Posts: 103
- Thank you received: 0
7 years 11 months ago #19335
by mrul3s
Replied by mrul3s on topic How to call a subroutine from inside another ?
Create PGM.FILE of subroutine which you want to call another routine with TYPE.............. S
and call this subroutine to another routine with function CALL
Like,
CALL SUBROUTINE.NAME
and call this subroutine to another routine with function CALL
Like,
CALL SUBROUTINE.NAME
Please Log in or Create an account to join the conversation.
- Moe_T24
- Topic Author
- Offline
- Senior Member
- T24 Technical
Less
More
- Posts: 57
- Thank you received: 1
7 years 11 months ago #19336
by Moe_T24
Best Regards
Replied by Moe_T24 on topic How to call a subroutine from inside another ?
Yeah I know that. But should you use like $INCLUDE SOME.ROUTINE.NAME .
Because I call it but it gives error when compile .
Because I call it but it gives error when compile .
Best Regards
Please Log in or Create an account to join the conversation.
- Moe_T24
- Topic Author
- Offline
- Senior Member
- T24 Technical
Less
More
- Posts: 57
- Thank you received: 1
7 years 11 months ago #19337
by Moe_T24
Best Regards
Replied by Moe_T24 on topic How to call a subroutine from inside another ?
Ok solved it. misspelling in the called routine name ! My bad !
Thanks anyway .
Thanks anyway .
Best Regards
Please Log in or Create an account to join the conversation.
- VK
- Offline
- Platinum Member
- Globus:G09-G13|TAFC:R05-R23|TAFJ:R19,R23:test
Less
More
- Posts: 1116
- Thank you received: 150
7 years 11 months ago #19399
by VK
Cheers
VK
Replied by VK on topic How to call a subroutine from inside another ?
Hi there,
a bit late reply but I signed up to this forum only couple of days ago.
INSERT won't call your subroutine, it will only include its code at the place where you issue the INSERT (like you copy and paste it there).
Use CALL to call your subroutine, e.g.:
A subroutine:
SUBROUTINE INCR.NUM(P.NUMBER)
* increase the parameter
P.NUMBER ++
RETURN
END
Program that calls it:
a_number = 1
CALL INCR.NUM(a_number)
CRT a_number ;* output: 2
You can also use a variable with subroutine name to call it:
a_subr = 'INCR.NUM'
CALL @a_subr(a_number)
Last but not least - you don't need PGM.FILE record to do that.
a bit late reply but I signed up to this forum only couple of days ago.
INSERT won't call your subroutine, it will only include its code at the place where you issue the INSERT (like you copy and paste it there).
Use CALL to call your subroutine, e.g.:
A subroutine:
SUBROUTINE INCR.NUM(P.NUMBER)
* increase the parameter
P.NUMBER ++
RETURN
END
Program that calls it:
a_number = 1
CALL INCR.NUM(a_number)
CRT a_number ;* output: 2
You can also use a variable with subroutine name to call it:
a_subr = 'INCR.NUM'
CALL @a_subr(a_number)
Last but not least - you don't need PGM.FILE record to do that.
Cheers
VK
Please Log in or Create an account to join the conversation.
- Forum
- T24 Technical Discussions
- T24 Development & Customization
- How to call a subroutine from inside another ?
Time to create page: 0.114 seconds