Self-reproducing Codeunit NAV 5.0

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2010-06-03 in Download section
Self-reproducing Codeunit NAV 5.0
This codeunit might be of interest to some of the academic-minded programmers out there. OnRun creates a text-file, containing the whole object. I knew, that this had already been done for other programming languages, so I asked myself, what it would look like in Navision. Well, here is the answer.

http://www.mibuso.com/dlinfo.asp?FileID=1179

Discuss this download here.

Comments

  • matttraxmatttrax Member Posts: 2,309
    I don't see the usefulness of this. What's the difference between this and doing a Save As text file?

    Or am I not understanding something?
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I think it was written to prove a theoretical concept: http://en.wikipedia.org/wiki/Self-repli ... er_program
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • rdebathrdebath Member Posts: 383
    matttrax wrote:
    I don't see the usefulness of this. What's the difference between this and doing a Save As text file?

    Or am I not understanding something?
    I've used this technique to make some self modifying code in a manner similar to the migrate.fob tool, I wanted to keep a routine in one dataport.

    But in practice it's a pain to modify unless you make a generator that turns any object into a self replicating object by filling in a function with the text version of the rest of the object. The generator could exist in the same object though. But if you do that you might as well just export the current object as text and modify it in place. :-?

    I got bored at that point and just generated a codeunit. :roll:
  • wernerpohlnerwernerpohlner Member Posts: 1
    matttrax wrote:
    I don't see the usefulness of this. What's the difference between this and doing a Save As text file?

    Or am I not understanding something?
    Surely, we will never meet a client demanding a self-reproducing codeunit (hopefully). I would call it a small programming exercise, which has no obvious solution at the first glance. I think, sometimes it's worthwhile to tackle that kind of problems, because one can improve programming skills.
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    OT: This could be the first step towards a SkyNet Edition of NAV :mrgreen:
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • David_SingletonDavid_Singleton Member Posts: 5,479
    I think its really important for someone learning a new language to play with ideas and do "stupid" things. When Financials first came out I did all sorts for things that had no value. Especially with forms, making forms that would re-size or buttons to move them, changing visible and moving one control relative to another, eventually leading to me creating a version of WinMine. Every time a new function came out I tried something with it. Of course none of those objects are of any use, since it was the learning experience of doing it that had value, not the final result.

    Don't just post invoices (even though that is important) but also do fun stuff, you will be amazed how useful that is in the years to come.
    David Singleton
  • crisnicolascrisnicolas Member Posts: 177
    I think its really important for someone learning a new language to play with ideas and do "stupid" things. When Financials first came out I did all sorts for things that had no value. Especially with forms, making forms that would re-size or buttons to move them, changing visible and moving one control relative to another, eventually leading to me creating a version of WinMine. Every time a new function came out I tried something with it. Of course none of those objects are of any use, since it was the learning experience of doing it that had value, not the final result.

    Don't just post invoices (even though that is important) but also do fun stuff, you will be amazed how useful that is in the years to come.

    =D>
  • David_SingletonDavid_Singleton Member Posts: 5,479
    I think its really important for someone learning a new language to play with ideas and do "stupid" things. When Financials first came out I did all sorts for things that had no value. Especially with forms, making forms that would re-size or buttons to move them, changing visible and moving one control relative to another, eventually leading to me creating a version of WinMine. Every time a new function came out I tried something with it. Of course none of those objects are of any use, since it was the learning experience of doing it that had value, not the final result.

    Don't just post invoices (even though that is important) but also do fun stuff, you will be amazed how useful that is in the years to come.

    =D>

    Thanks!
    David Singleton
Sign In or Register to comment.