| Author | Topic: Interactive and search files (Read 115 times) |
maslow New Member
 member is offline
Joined: Sept 2008 Gender: Male  Posts: 1
|  | Interactive and search files « Thread Started on Nov 11, 2008, 7:59am » | |
I'm trying to take care of a theos basic program as it's designer is retiring, how do I start something in interactive mode and how do I search a directory for a specific word or string?
The actual production program is in 4.1, I have a box that is supposed to have a running version of it for my development, but it appears to be in corona so things are different and I can't get the program to run. It says error 255, and I think the guy cleaned all the data files off of it before he handed it over, so that might be the problem.
| |
|
Fbugg Guest
|  | Re: Interactive and search files « Reply #1 on Nov 11, 2008, 8:08pm » | |
Although I got a copy of Corona years ago, I still have 4.0-4.2 on the clients I deal with.
Typically from a basic program a filelist is initiated by: CSI "F[ilelist] "&path&filename.filetype (or libraryname.librarytype.filename)
For example if you are searching for company.file lets say in the main directory of the account you are in CSI "F Company.File"
if you are using subdirectories, it might be something like CSI "F /CompFLS/Company.File"
Now remember that CSI closes all open files, so if you have files open before doing this, you may need to reopen them.
If you are doing it with variables, FINAME$="Company.File" Pth$="/CompFLS/" DRV$=":S" CSI " "&PTH$&FINAME$&DRV$
There is also a shell command available like most other basics, so that could be used, or develop an EXEC program to do the file list and call that from the basic program. EXEC commands are a little different so you should use HELP EXEC and any manuals you have to familiarize yourself with that.
Hope that helps
Buff
| |
|
buff2 Guest
|  | Re: Interactive and search files « Reply #2 on Nov 11, 2008, 8:10pm » | |
The library reference should read Libraryname.Filename.membername
Sorry for not stating it correctly
| |
|
buff2 Guest
|  | Re: Interactive and search files « Reply #3 on Nov 14, 2008, 4:04pm » | |
You could also send it to a file. Easiest way is to use the built-in Filelist options. CSI "F "&FINAME$&"."&FITYPE$&" (FILE FT"
This will put the files that match FINAME$.FITYPE$ into a file called Selected.files. The FT tells it to stop at the file type with no more information. If it's a library You can use MN instead of FT to stop at the member name. You can then open selected.files and read the entries there (as I recall use LINPUT rather than READ).
| |
| |
|