Calling Function Library

  1. 3 weeks ago

    Peter L

    Jun 4 Pre-Release Testers, Xojo Pro

    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

  2. Wayne G

    Jun 5 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    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.

  3. Gavin S

    Jun 5 Pre-Release Testers, Xojo Pro UK

    @Peter L 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

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

    https://www.xojo.com/download/extras.php

  4. Markus W

    Jun 5 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...

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

  5. 2 weeks ago

    Peter L

    Jun 10 Pre-Release Testers, Xojo Pro

    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.

  6. Emile S

    Jun 10 Europe (France, Strasbourg)

    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 ?

  7. Peter L

    Jun 11 Pre-Release Testers, Xojo Pro

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

or Sign Up to reply!