Format question

Wil Dijkstra W.Dijkstra at fsw.vu.nl
Mon Jun 7 11:12:40 EDT 2004


Try this for each line in your script:

  put false into isQuoted
  put empty into myLastChar
  repeat with i = length (myScriptLine) down to 1
    put char i of myScriptLine into ch
    if ch is quote then put not isQuoted into isQuoted
    if isQuoted then
      put empty into myLastChar
      next repeat
    end if
    if not isQuoted then
      if myLastChar is space then
        if ch is space then delete char i of myScriptLine
      end if
    end if
    put ch into myLastChar
  end repeat

Wil Dijkstra

-----Original Message-----
From:	Simon Lord [mailto:slord at marelina.com]
Sent:	Mon 6/7/2004 9:42 AM
To:	MetaCard
Cc:	
Subject:	Format question

I have a tricky issue where I want to run a script to remove double 
spaces in the script of an object but not damage any code which is 
actually injecting it into something.  To be clear, I want the 
following:

set the visible   of image "monkey"  to   true

... to look like this:

set the visible of image "monkey" to true

... but what i don't want to do is affect any code trying to do 
something with spaces.  For instance:

put "Hello    there" into fld 1

... depending on how many times I run my code to clean the extra spaces 
between words this script can end up looking like this:

put "Hellothere" into fld 1

So I guess what I'm saying is I don't want to affect spaces between 
quotes.

Any ideas?

Sincerely,
Simon

_______________________________________________
metacard mailing list
metacard at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/metacard



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 2888 bytes
Desc: not available
Url : http://lists.runrev.com/pipermail/metacard/attachments/20040607/f36bc2bb/attachment.bin


More information about the metacard mailing list