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

"Reawakening" of an @Index issue...

Discussion in 'Support' started by mathewsdw, Sep 2, 2011.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    I previously submitted this with no real resolution that I could find in this forum and just “left it alone” because it did have a fairly simple workaround (namely testing the return from "@Index" for "LT 0" rather than "== -1"). But the simple fact is that the @Index function is returning a value that it, put simply, should absolutely never, according to the documentation, ever, return under any circumstances whatsoever, specifically the number “-7”, and I can’t help but think that Rex might want to fix it. Now I will add, as almost a side comment, that this is even stranger than I would have possibly imagined before doing the "research" I needed to do to submit this posting!

    Specifically, the the Error.btm file contains the following code (this is a "straight" copy with no "modifications of any kind whatsoever):
    Code:
    @Echo Off
    SetLocal
    Set ArchivePathName=%@UnQuote[%1]
    Gosub CheckDrive %ArchivePathName
    EndLocal
    Quit 0
    :CheckDrive [PathToBeChecked]
    @Echo On
    @Echo PathToBeChecked: %PathToBeChecked
    @Echo Set I=@Index[%PathToBeChecked,:,-1]
    Set I=%@Index[%PathToBeChecked,:,-1]
    @Echo I: %I
    If %I LT 0 Return 4
    Return 0
    
    This is one run and its output (which is completely "sensible"):
    Code:
    [Z:\]Error ThisIsATest.7z
    PathToBeChecked: ThisIsATest.7z
    Set I=@Index[ThisIsATest.7z,:,-1]
    Set I=-1
    I: -1
    If %I LT 0 Return 4
    EndLocal
    Quit 0
    This is another run, and its output, and I will note in advance to save you some time in trying to figure out exactly what the difference(s) are, is that this time I am invoking it with two parameters (the second one being the word "junk"), but if you look at the above code, you will see that the parameter "%2" is never even referenced, not as "itself" and not as the result of a "Shift" command.
    Code:
    [Z:\]Error ThisIsATest.7z junk
    PathToBeChecked: ThisIsATest.7z
    Set I=@Index[ThisIsATest.7z,:,-1]
    Set I=-7
    I: -7
    If %I LT 0 Return 4
    EndLocal
    Quit 0
    
    I don’t think there’s much else to say here, although I am including a "zipped" copy of the exact same .btm file that I am running above so anyone else can check it out to their heart's content, so to speak, although I absolutely will not be surprised if they do not get the same results that I am getting!! I wil also note here that at this time the "full" .btm file that this code was extracted from is doing absolutely nothing but "parsing" an input parameter, but I really don't see the relevance of that fact given that the above and attached code is giving me the results that it is.

    TCC 12.11.73 Windows 7 [Version 6.1.7601]
     

    Attached Files:

  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,726
    Likes Received:
    80
    Not reproducible in the current release (12.0.74). Update your version and let me know if you still have a problem.
     
  3. David Marcus

    Joined:
    Jun 4, 2008
    Messages:
    646
    Likes Received:
    1
    I can't reproduce it:

    C:\Junk>ErroS ThisIsATest.7z
    PathToBeChecked: ThisIsATest.7z
    Set I=@Index[ThisIsATest.7z,:,-1]
    Set I=-1
    I: -1
    If %I LT 0 Return 4
    EndLocal
    Quit 0

    C:\Junk>ErroS ThisIsATest.7z junk
    PathToBeChecked: ThisIsATest.7z
    Set I=@Index[ThisIsATest.7z,:,-1]
    Set I=-1
    I: -1
    If %I LT 0 Return 4
    EndLocal
    Quit 0

    C:\Junk>ver /r

    TCC 12.11.74 Windows Vista [Version 6.0.6002]
    TCC Build 74 Windows Vista Build 6002 Service Pack 2
    Registered to David Marcus - 1 System License

    C:\Junk>
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    I still have 12.11.73 -- and I can't reproduce it, either.
     
  5. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    605
    Likes Received:
    0
    TCC 12.11.74 x64 Windows 7 [Version 6.1.7600]
    TCC Build 74 Windows 7 Build 7600

    I can not reproduce the reported problem.

    On Fri, Sep 2, 2011 at 08:01, Charles Dye <> wrote:




    --
    Jim Cook
    2011 Monday: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Tuesday.
     
  6. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    560
    Likes Received:
    8
    I'm also unable to get it to show up. I even created your test environment as best I was able (subst'd Z: drive, Error.btm, 7-ZIP file with the same name).

    TCC 12.11.74 Windows XP [Version 5.1.2600]
    TCC Build 74 Windows XP Build 2600 Service Pack 3

    Code:
    [Z:\]Error ThisIsATest.7z
    PathToBeChecked: ThisIsATest.7z
    Set I=@Index[ThisIsATest.7z,:,-1]
    Set I=-1
    I: -1
    If %I LT 0 Return 4
    EndLocal
    Quit 0
    
    [Z:\]Error ThisIsATest.7z junk
    PathToBeChecked: ThisIsATest.7z
    Set I=@Index[ThisIsATest.7z,:,-1]
    Set I=-1
    I: -1
    If %I LT 0 Return 4
    EndLocal
    Quit 0
    
     
  7. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Well, Rex, I installed the new release in a "side-by-side" installation, and I do not appear to have the problem anymore. But, unfortunately, that's not proof of anything at all because TCC 12.11.73 (I did a side-by-side installation of .74 as I always do) is not exhibiting the problem anymore, either. (This is not all that surprising because it is my distinct recollection that the problem randomly "comes and goes", and has been doing so for a fairly long time.) However, as I previously indicated, if I test the return from @Index for "LT 0" rather than "== -1", the problem goes away, although I will, from now on, in the "LT 0" case test for the index being something other than "-1" and report that fact if that, in fact, turns out to be the case. The real problem here, for me, is that I'm strongly in the habit of testing for "== -1" and not "LT 0", but having to put in the additional test, above, may "break" me of that habit...

    And on a related note, I have a completely "normal" system in every way (with absolutely no installed "non-commercial software) but one: my "Z" drive is a RAM disk that I've been using for a good number of years (but did not originally get from the Microsoft website because theirs, which is purely a "sample", is not nearly as good as the one I actually have installed is) and I will say that I've had absolutely no problems with it for many years and have found it to be quite "safe" because it saves its contents to hard disk on system shutdown and reloads it on system start up (unlike the Microsoft "sample") so it is quite "transparent" to the end-user (me). It has the advantages that: 1. It is quite a bit faster than a "hardware" disk, 2. Using it avoids fragmenting my "real" hard disk(s) because I only save stuff to a "real" hard disk when I'm basically finished with it (and "fragmentation" of a RAM disk is totally irrelevant because of a RAM disk's inherent speed), 3. "Temporary" files never get written to a "real" hard disk in the first place, and 4. My "real" hard disk partitions, other than my external 1TB hard-disk that I use purely for "backup" purposes, are all more than 90% full at this point in time so I'd like to avoid writing files to them that I don't need to. And since this is a laptop, upgrading the "internal" hard disk could be somewhat of a problem. Because of my bad memory, I'm not completely sure from where I got it anymore, although I do have a file "Dataram_RAMDisk_V3.5.130R18.msi" in a directory named "Downloads\RAM Disk", and they are still offering it (for free) on their website (http://memory.dataram.com/products-and-services/software/ramdisk - "Download it - Dataram RAMDisk (3.0 MB) button - freeware download..." on the far-right side of the lower part of the page) , and I would assume (since it doesn't say anything either way) that it's Windows 7 compatible. While I'm really not recommending it, per se, because this is something whose use is strictly a matter of "personal preference", I would say that if it is something that is of interest to you you can go to that website and download and install it.

    And, finally on this subject, I've got literally dozens of C++ (and a few Visual Basic programs) that I've written over the years, but all of them are "straight" applications and, particularly for the C++ programs, are command-line programs that also run just fine under cmd.exe and only run when you actually run them (from a command line) because absolutely none of them has anything that "sticks around" in memory after execution ceases - I have no need whatsoever to write "device drivers" and such.
     
  8. DMcCunney

    Joined:
    Jun 7, 2008
    Messages:
    96
    Likes Received:
    3
    On Fri, Sep 2, 2011 at 10:10 PM, mathewsdw <> wrote:


    I'm aware of the MS ramdisk. They provide sample ramdisk driver code
    as part of one of their SDKs, and several third-party offerings have
    been based on it. It works, but as is typical with a Microsoft
    offering like this, far better third-party alternatives exist.

    I run a ramdisk here under XP, but not one from MS. I have a CoreDuo
    system with 4GB RAM, bit for architectural reasons, 32 Windows can
    only see/use about 3.2GB of it. I wanted to use the extra RAM for
    something, and used to use a ramdisk in the MS-DOS days, so I went
    looking for a ramdisk driver that could use the "hidden" memory. I
    found one called Vsuite ramdisk that can. I now have a 763MB ramdisk
    identified as Z:, and seen by Windows as a compressed NTFS file
    system. I have %TEMP% and %TMP% set to point to it for programs that
    use that variable to specify where they should create temp files.

    The main use is testing. I use most of what Mozilla makes, with
    Firefox as my preferred browser, and Thunderbird for newsreading, and
    I have SeaMonkey (which I used back before Firefox matured), Sunbird,
    and Kompozer installed as well. I beta-test Mozilla stuff, and
    currently have Firefox 7, Aurora (which will be Firefox 8) and Nightly
    (which will be Firefox 9) installed and switch between them, using a
    common profile. It's all run from the ramdisk. a logon script copies
    everything to the ramdisk when I boot, and a logoff script saves
    changes back to the hard drive when I logoff/shutdown. It works fine
    and is delightfully quick. I make heavy use of extensions in Firefox,
    and have about 100 installed. These normally affect load time, as FF
    must enumerate and instantiate them all on startup. Load time for any
    of the three versions from the ramdisk is about 4 seconds.

    VSuite exists in several versions. I use the freeware version, which
    does everything I require, but shareware versions with more features
    are available.
    _____
    Dennis
     
  9. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    My RAM disk saves itself to a "real" hard disk on system shutdown and reloads itself from that hard disk on when the system comes back up.
    Dennis, I updated my posting to this thread that you replied to evidently while you were writing this reply. I definitely did not get the RAM disk I am using from Microsoft, I think (mostly because it is the only identifiable RAM Disk "install" file that I can find on my system) that I got it from the website of a company named "DATARAM" ("http://memory.dataram.com/products-and-services/software/ramdisk") and, while I am certainly not criticizing yours in any way (particularly if you are completely happy with it), I am completely happy with mine. I could not possibly think of any worthwhile improvements that could be made to it, and, again, it was absolutely free with no limitations of any kind that I am aware of.
     

Share This Page