T O P I C R E V I E W |
tib |
Posted - 01/17/2002 : 08:33:26 AM I'm looking for a sequence which does not stop when a data file is not found.
The following example works fine for one single file
[ImportData] TMP=fdlog.open(Z); if (TMP==0) {open -w %Z;} else {type File %Z was not found. Try another one!};
But what can I do when I generate the file names by myself?
loop (i,1,100) { %M=Sample$(i); win -t wks Template %M; // open template; open -w %M; // import data; };
Is there a way with fdlog....?
Thank you for any hints! Tilman.
By the way, did you know that origin hangs up after 255 loops, When running: loop (i,1,300) {win -t wks};? |
8 L A T E S T R E P L I E S (Newest First) |
Mike Buess |
Posted - 01/22/2002 : 4:51:57 PM quote: I did a bit of checking and apparently there is NOT a hard limit of 255 worksheets in an Origin project. However, I am told that attempting to create a project with such a large number of visible worksheet windows is impractical because you will likely exhaust system resources. If such a large project is necessary, you are advised to hide worksheet windows that are not being operated on.
This topic discusses some of the problems involved with large projects and hiding windows seems to be an imperfect solution. I generally try to avoid large projects because, aside from practicality, they seem to get corrupted easier.
Mike Buess Origin WebRing Member |
Mike |
Posted - 01/22/2002 : 4:00:57 PM Hi Tilman and Craig:
I did a bit of checking and apparently there is NOT a hard limit of 255 worksheets in an Origin project. However, I am told that attempting to create a project with such a large number of visible worksheet windows is impractical because you will likely exhaust system resources. If such a large project is necessary, you are advised to hide worksheet windows that are not being operated on.
Tilman's script...
loop (i,1,300) {win -t wks};
...does indeed fail but we suspect some limitation in the worksheet autonaming routine. We found that...
loop (ii,1,300) { win -t wks origin MyWks$(ii); win -ch 1; }
...works fine (note that we bypass the autonaming routine by assinging a name to the wks). But again, including such a large number of worksheet windows in a single project may cause other problems - not just with Origin but with other applications that may be running.
I hope that this helps to clear some things up.
Mike OriginLab Tech Support
|
marko |
Posted - 01/21/2002 : 03:19:57 AM One could also try to use the OFILEMAN.OPK package of Origin's free addons!
Marko
|
Mike Buess |
Posted - 01/17/2002 : 2:57:57 PM The documentation that you quoted for the exist(filename,n) is wrong. See this topic for more.
file.exists() is a File Utilities Module command. The FUM is documented in the OriginPro manual.
Mike Buess Origin WebRing Member |
CStorey |
Posted - 01/17/2002 : 2:55:38 PM Hi Mike,
I'd like to put my name down as well to expand the 255 wks limit. I've never encountered it, but I come dreadfully close to this all the time. Guess I've just been lucky so far.
Thanks. Craig
Craig Storey Origin WebRing Member - http://g.webring.com/hub?ring=originwebring |
Mike |
Posted - 01/17/2002 : 12:56:24 PM There is a 255 worksheet limit in an Origin project file (or at least there was with version 6.0 and I don't think that has changed). So that's why...
loop (i,1,300) {win -t wks};
...causes Origin to hang (though that probably isn't the ideal behavior, so I'll look into it and enter an item in our database if it seems warranted). Thanks.
Mike OriginLab Tech Support |
tib |
Posted - 01/17/2002 : 11:02:34 AM Thanks a lot! It works. How did you know about this command? My LabTalk V6 manual says nothing about file.exist() and the function exist() is just for worksheets, graphs, matrices... and retuns 0...9. I just found out that exist(Layout) returns 11. That's also not in the manual.
In the online help there is a function exist(fileName,n): Use this notation to check the version number and date of a DLL. If n=1, 2, 3, or 4, this function returns the first, second, third, or fourth byte from the version resource. Thus, if the version is 6.107 and n=3, the function returns 0. To return the date (in double) of the DLL, set n=5. This is the same unit as the @D system variable. But it does not tell you that it works without 'n' and that you get the filesize of the file nor you get a -1 if the file does not exist.
I get the impression that there are lots of interesting and important things which are not documented in the manual. Is there maybe a complete online-manual or at least sections which are kept up-to date? |
eparent |
Posted - 01/17/2002 : 09:31:18 AM To test the existence of a file use LabTalk's Exist function.
Syntax: FileSizeInK = Exist(FullPathFileName);
Example: // Get K size of Origin's ini file. k = Exist(%yOrigin.ini);
The return value is the file size in K or -1 if the file does not exist.
Or use LabTalk's File Object.
exist = File.Exist(FullPathFileName); // Returns 0=not found, or 1=exist
|
|
|