1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Calling all cyberentomologists....

Discussion in 'Plugins' started by Charles Dye, Sep 19, 2012.

  1. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    "It's a bug hunt." -- Cpl. Hicks

    I've put up a new build of TextUtils: http://prospero.unm.edu/plugins/textutils.html

    I've found several bugs in the last few days, one downright humiliating, so it looks like I need more eyes on this plugin. Would some of you mind beating on this one and letting me know what else is broken? Thanks!
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    This is not a bug report, rather, a wish list.
    1/ do not use _WC - in many countries "WC" refers to a public toilet ("water closet")
    2/ some of the features are not text related, e.g. loadarray/savearray, @inivalue. They should be in a different plugin.
    3/ it would be nice for @inivalue[] to be accompanied with an internal variable, set to a code reflecting the line number in the file for success, or for one of the error conditions "no file", "file not accessible", "no section", "no entry"...
    4/ @inivalue needs a matching function to update .INI files. Such a function should be able to accept an empty "section" as "before the first section header" just as @inivalue, be able to delete or modify an existing line, or insert a new line at any specific location - including "before the first occurrence of section/enty" or "after the last occurrence of section/entry".
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    I know; you can use that variable in loo of the Unix utility.

    They have more in common that you realize; most of them share a lot of the same underlying functions. I could break them out into different plugins, but they'd get correspondingly bigger. Or I could rename the plugin to "Memory-mapped OEM/UTF-16LE/UTF-16BE/UTF-8 text file utilities" -- more accurate, but not as catchy.

    Hmmm. I'll look at it; probably not too difficult.

    I agree that that would be a great feature, but at this point I don't know how to implement it! It's probably a much more complex exercise than just reading.
     
  4. dcantor

    Joined:
    May 29, 2008
    Messages:
    505
    Likes Received:
    3
    Arrggghhhh!!!!! You were probably saving that one in your reservoir for years. I'd make another pun, but I think it's time to flush the topic.
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    It's a good thing they don't issue fatwas for puns. (Good for me, anyway; I don't know about the rest of you.)
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Regarding the mixing of text and non-text features in a single plugin due to shared low-level routines, you could put the shared routines in a separate DLL loaded automatically when either of its callers is loaded, which would make total memory usage nearly the same as now, but this would not be consistent with the independence of each plugin, and would require installers for most anyone not a professional programmer. Possibly a different name reflecting the greater generality?

    Another desired set of enhancements for SAVEARRAY and LOADARRAY would be
    1/ the ability to save or load a part of the array only, specified in the manner of Fortran:
    savearray [/o] myarray[3:9] myarrayfile
    where the 3:9 are inclusive element offsets
    2/ use another array instead of a file for saving to/loading from.

    In general, it would be nice to have some array operators, similar to the matrix manipulation routines available in some HLLs.

    Undoubtedly very much more complex because it requires modification of the file. Basically it is a file editing function, which can change the middle of a file, and that cannot be done without first saving and then rewriting the rest of the file. If the file were mapped into an array, one whole line per array element, and if we had commands to copy partial arrays, this would be simple.
     
  7. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    If you had the ability to reload partial arrays, would there really be any need to save partial arrays?

    I've put up an updated build with an _INIVALUERC variable to report the completion status of the last call to @INIVALUE.
     
  8. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Yes - if you want to save a small part of a very large array. Furthermore, my concept for saving a partial array is to save the subarray as if it were a whole array, so the using the current LOADARRAY into a new array from the file into which the subarray was saved would populate the upper left corner of the target array to the size of the saved subarray, independently from the size of the original array.
     
  9. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Yes - if you want to save a small part of a very large array. Furthermore, my concept for saving a partial array is to save the subarray as if it were a whole array, so the using the current LOADARRAY into a new array from the file into which the subarray was saved would populate the upper left corner of the target array to the size of the saved subarray, independently from the size of the original array.
     

Share This Page