# Calling Function Library

**URL:** <https://forum.xojo.com/t/calling-function-library/43790>\
**Category:** Getting Started\
**Created:** [June 5, 2018, 6:05am UTC](https://forum.xojo.com/t/calling-function-library/43790 "2018-06-05T06:05:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Lawrence](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/df705f/32.png) [@Peter\_Lawrence](https://forum.xojo.com/u/Peter_Lawrence)\
**Post date:** [June 5, 2018, 6:05am UTC](https://forum.xojo.com/t/calling-function-library/43790/1 "2018-06-05T06:05:04Z")

</div>

I have a text file which contains around 150 useful functions. They are written in VB but should be easy to translate into Xojo. The question I have is how do I include them in a project so that they are globally accessible?

I know I can create a module and add them as Methods but to do that for so many functions would be tedious. Is there some simpler way to bring the whole file into Xojo and have all of the functions individually callable?

Cheers,  
Peter

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [June 5, 2018, 8:29am UTC](https://forum.xojo.com/t/calling-function-library/43790/2 "2018-06-05T08:29:56Z")

</div>

They’re going to have to be converted to Xojo once, but after that is done you can make the module external and include it (with all functions/methods) either as an external item or simply import the module.

I have a library of functions/methods that I keep external, but include the link in my template projects.

---

<div class="post-metadata">

**Author:** ![Gavin\_Smith](https://forum.xojo.com/user_avatar/forum.xojo.com/gavin_smith/32/13901_2.png) [@Gavin\_Smith](https://forum.xojo.com/u/Gavin_Smith)\
**Post date:** [June 5, 2018, 8:35am UTC](https://forum.xojo.com/t/calling-function-library/43790/3 "2018-06-05T08:35:42Z")

</div>

[quote=390689:@Peter Lawrence]I have a text file which contains around 150 useful functions. They are written in VB but should be easy to translate into Xojo. The question I have is how do I include them in a project so that they are globally accessible?

I know I can create a module and add them as Methods but to do that for so many functions would be tedious. Is there some simpler way to bring the whole file into Xojo and have all of the functions individually callable?

Cheers,  
Peter[/quote]

The old VB Migration Assistant might remove some of the busy work here.

[https://www.xojo.com/download/extras.php](https://www.xojo.com/download/extras.php)

---

<div class="post-metadata">

**Author:** ![Markus\_Winter](https://forum.xojo.com/user_avatar/forum.xojo.com/markus_winter/32/144_2.png) [@Markus\_Winter](https://forum.xojo.com/u/Markus_Winter)\
**Post date:** [June 5, 2018, 10:45am UTC](https://forum.xojo.com/t/calling-function-library/43790/4 "2018-06-05T10:45:28Z")

</div>

You might see it as an opportunity to go over all the functions and make sure they are cross-platform and 64bit safe 

---

<div class="post-metadata">

**Author:** ![Peter\_Lawrence](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/df705f/32.png) [@Peter\_Lawrence](https://forum.xojo.com/u/Peter_Lawrence)\
**Post date:** [June 10, 2018, 10:51am UTC](https://forum.xojo.com/t/calling-function-library/43790/5 "2018-06-10T10:51:44Z")

</div>

Thanks to everyone for taking the time to reply, I sincerely appreciate it.

What I have is not a VB project but a collection of VBA functions in a text file so unfortunately the migration assistant doesn’t seem to help.

It looks like all I can do is manually convert the functions into module methods so I’m onto that task now. It’s tedious but I thought it was worth asking here just in case there was a shortcut I was missing.

It’s interesting to see (be caught out) by some of the subtle differences between languages. For example, it turns out that the atan2 function in VBA has parameters x, y whereas Xojo (and most other languages) have parameters y,x. That had me scratching my head for a while.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [June 10, 2018, 12:49pm UTC](https://forum.xojo.com/t/calling-function-library/43790/6 "2018-06-10T12:49:21Z")

</div>

What about xml or bas project save / insert the Functions (after checkig how is the syntax) / save and import the project: less text to write ?

---

<div class="post-metadata">

**Author:** ![Peter\_Lawrence](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/df705f/32.png) [@Peter\_Lawrence](https://forum.xojo.com/u/Peter_Lawrence)\
**Post date:** [June 12, 2018, 2:16am UTC](https://forum.xojo.com/t/calling-function-library/43790/7 "2018-06-12T02:16:20Z")

</div>

@Emile Schwarz: That’s an interesting approach. I’ll give it a go. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 7:14pm UTC](https://forum.xojo.com/t/calling-function-library/43790/8 "2020-10-29T19:14:22Z")

</div>


