Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Persistent Variables

  1. #11
    Active Member
    Join Date
    2009-03
    Posts
    63
    Login to Give a bone
    0

    Default Re: Persistent Variables

    per-var.txt

    This is after I tested the code, the original was just blank. I'll look into your suggestions too, I always find out I end up using 10 lines of code when 3 will work.

    I don't know how it would work with combining the "w" and "r" parts of the first portion. Can you use (read-line) when the file is open to "W"? The first portion is there to create the file if its not found. If you can't use read-line there, it would need closed and re-opened as "R" anyway, if you can, then it would only need the "w" either way. Experiment time I'd say... looks like nope. Still neat thought, I haven't considered using an if function like that thought it makes sense now that I'm looking at it. Still I'm kinda slapping my head that I didn't use the (getenv "userprofile") from the get-go. Can't assume everyone uses c:\ for their system files. Could probably ditch the documents folder too, just in case someone had gotten rid of that folder. Or add a "search-and-create-if-not-found" snippet for the document folder.

  2. #12
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Persistent Variables

    Quote Originally Posted by ccalder View Post
    ... I always find out I end up using 10 lines of code when 3 will work.
    Such is the nature of development; you should see my .NET applications source-code.



    Quote Originally Posted by ccalder View Post
    I don't know how it would work with combining the "w" and "r" parts of the first portion. Can you use (read-line) when the file is open to "W"? The first portion is there to create the file if its not found. If you can't use read-line there, it would need closed and re-opened as "R" anyway, if you can, then it would only need the "w" either way. Experiment time I'd say... looks like nope. Still neat thought, I haven't considered using an if function like that thought it makes sense now that I'm looking at it. Still I'm kinda slapping my head that I didn't use the (getenv "userprofile") from the get-go. Can't assume everyone uses c:\ for their system files. Could probably ditch the documents folder too, just in case someone had gotten rid of that folder. Or add a "search-and-create-if-not-found" snippet for the document folder.
    Your original code perplexed me, being hones; I just slapped that together while my project submittal was printing, hence wanting to know more.

    I still feel that this is a bit more complicated than it needs to be - creating a new mechanism for storing typed-values to an external file, when there already exists a low-risk means by which to do same using built-in functions with HKCU hive in Registry.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Textures need to be persistent.
    By Wish List System in forum Inventor Wish List
    Replies: 0
    Last Post: 2014-11-16, 09:27 PM
  2. Reactors - Persistent, LData, XData...
    By stusic in forum AutoLISP
    Replies: 5
    Last Post: 2013-05-22, 01:42 PM
  3. Adding persistent custom scales
    By some buddy in forum Revit - Platform
    Replies: 2
    Last Post: 2010-06-28, 03:36 PM
  4. Adding persistent custom scales
    By some buddy in forum Revit - API
    Replies: 2
    Last Post: 2010-06-28, 03:25 PM
  5. AutoCAD-style persistent properties dialog
    By Scott D Davis in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2004-10-20, 06:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •