Home AMX User Forum NetLinx Studio

persistent values in Modules

eddymouseeddymouse Junior MemberPosts: 67
Hi, How can I memory persistent variables in Modules? I need to write in a file? How the files system work? Where can I find more information about?
Thank you
Alex

Comments

  • OnkelzOnkelz Junior Member Posts: 7
    Hi

    Sadly, persistent variables do not work in Modules!
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    eddymouse wrote: »
    Hi, How can I memory persistent variables in Modules? I need to write in a file? How the files system work? Where can I find more information about?
    Thank you
    Alex


    You could write them to an XML file on the disk.
  • mpullinmpullin Obvious Troll Account, Marked for Deletion Posts: 949
    ericmedley wrote: »
    You could write them to an XML file on the disk.
    I think the original poster knows this and is asking for details on how to perform file-writing skills within Netlinx. Since I've never done this I can't help any, sorry.
  • eddymouseeddymouse Junior Member Posts: 67
    mpullin wrote: »
    I think the original poster knows this and is asking for details on how to perform file-writing skills within Netlinx. Since I've never done this I can't help any, sorry.

    Exactly! Now I'm trying to follow the manual. But It's not so clear....
    Thank you!
  • SensivaSensiva Junior Member Posts: 211
    While waiting....

    Do as I am doing... while waiting for someone to provide detailed info, read NetLinx Keywords help ROUGHLY and THROUGHLY.

    click Help, NetLinx Keywords Help, in Index tab type file, and you will find FILE_COPY, FILE_CLOSE, FILE_OPEN, ....etc.

    I think after few hours of tryouts you will find out what's the deal with files operations in Netlinx, and then start your own "HOWTO: Files in Netlinx" thread, and I guess it will be a great contribution from you...

    ;)
  • AMXJeffAMXJeff Senior Member Posts: 450
    eddymouse wrote: »
    Hi, How can I memory persistent variables in Modules? I need to write in a file? How the files system work? Where can I find more information about?
    Thank you
    Alex

    You can actually pass in a persistent variable to a module. The variable needs to be declared outside the module.
    DEFINE_VARIABLE
    PERSISTENT CHAR cWhatEver[100];
    
    DEFINE_START
    
    DEFINE_MODULE 'Whatever blah blah' modBlah(vdvStuff, dvStuff, cWhatEver);
    
    
  • DHawthorneDHawthorne Old Timer Posts: 4,584
    I'll usually do what AMXJeff suggests and declare it outside the module, then pass it as a parameter. If it's something more complex, like a structure, or an internal database, I'll write it to a file.
Sign In or Register to comment.