LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
OK, I'm grabbing a list of all files in a directory and popping them in a variable. I'm then going through each file and replacing some text in each one.
Now, I only want to do the above process on text files. Is there a way to *just* get all the files with a '.txt' extension?
On mouseUp
answer folder "a Folder"
if it = "" or the result <> "" then
exit mouseUp
end if
set the defaultfolder to it
set the itemdelimiter to "."
repeat for each file rWords in the files
if item -1 of rWords = "txt" then
put URL ("file:" & rWords) into kWords
-- do stuff here with kWords
end if
end repeat
end mouseUp
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Seems to me that it would be simpler to put all the names
into an array then delete the array elements which contain
the string ".txt" and process the rest.
I find the best way to learn a programming language is to have something to do. I've had RunRev on my laptop for over a year, but it's only now I really had a use for it.
I looked at existing scripts to get most of what I needed and then asked questions here, eventually the structure, syntax and design of RunRev begins to bed in.
Now looking to enhance the programs I've written which in itself will teach me even more.
Perhaps my "problem" is that I became very
proficient with dBase and FoxPro in the '80s so
usually go looking for something that was
available in those languages.
So knowing what I want to do I need to find a
way of doing it and going through stacks takes
a lot of time and then I mightn't find what I want.
Can you or anyone else tell my why the Rev help file
isn't at all like the one in the videos? If I had that
I'd be away....
Wonder if anyone has thought of having a Wiki-style
Rev resource where users could add ideas and code
which would be easily searchable. A lot of the sites
I've visited which claim to be devoted to Rev have
very little of use to me and a lot of them have that
"abandoned" look.