problem with counting words

Mark Wieder mwieder at ahsoftware.net
Sun Oct 12 20:32:42 EDT 2014


larry-

Sunday, October 12, 2014, 5:16:45 PM, you wrote:

> Hello Mark,
> It truly pleases me that you explained a reason for text within quotes being
> a single word.

Glad I could help.

> I don't have enough experience (actually none) in defining arguments for
> commandline syntax and would never have thought of that.
> So now I must say, "OK, there is a reason."

It's pretty simple, really. If I have a program that counts lines in a
file (let's call it linecount) and I want to call it with a file to
work on, then from a command prompt I would say something like

linecount fileToWorkOn.txt

However, if someone made a file with a name that had embedded spaces,

linecount some file with spaces.txt

wouldn't work because the first thing that would happen is the
linecount program would try to work on file "some". What I'd need to
do in that case is say

linecount "some file with spaces.txt"

And then the operating system would treat everything within the quotes
as a single parameter. So I can extrapolate from that to xtalk
languages treating everything within quotes as a single entity.

> If anyone knows how to do that for the IDE so that the function I write is
> now available to me for ANY script of ANY stack, I would love to hear about
> it.

Well, my first advice would be to wait for the next major version of
LiveCode, because the new initiative (I'm too tired and lazy at the
moment to look up the name) is designed to give you exactly that
capability.

But if you want to play around with it now, you'll want to read up on
frontscripts and backscripts. If you, for example, put a function into
a script and then insert the script into the backscripts, the function
will be available to any stack. This is a large part of how the IDE
itself works.

-- 
-Mark Wieder
 ahsoftware at gmail.com

This communication may be unlawfully collected and stored by the National 
Security Agency (NSA) in secret. The parties to this email do not 
consent to the retrieving or storing of this communication and any 
related metadata, as well as printing, copying, re-transmitting, 
disseminating, or otherwise using it. If you believe you have received 
this communication in error, please delete it immediately.





More information about the use-livecode mailing list