Repeat until (0r "while") not working

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Repeat until (0r "while") not working

Sivakatirswami
I'm missing something very simple here,

Goal: delete empty lines beginning and end of text chunk

---------------

put fld "transcript" into tFinalTranscript

# clean up extra lines at beginning and end

repeat while ((line 1 of tFinalTranscript) is empty)
   delete line 1 of tFinalTranscript
end repeat

repeat until ((the last line of tFinalTranscript) is not empty)
   delete the last line of  tFinalTranscript
end repeat

put tFinalTranscript
exit to top
------------
It still has all the empty lines top and bottom. If I globalize the  
temp variable for a bit, then test the field or the variable from the  
msg box:

"line 1 of tFinalTranscript is empty"  returns true
"the last line of fld "transcript" is empty" returns true

But these handlers are not deleting the blank lines as expected..  
what am I doing wrong? I don't think I need all those parentheses...  
only added to try to get it to work... still doesn't

TIA
Sivakatirswami



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Ken Ray
On 8/9/05 8:17 PM, "Sivakatirswami" <[hidden email]> wrote:

> I'm missing something very simple here,
>
> Goal: delete empty lines beginning and end of text chunk

Try this:

function trim pWhat
  local tRetVal
  get matchText(pWhat, "(?s)^\s*(.*?)\s*$", tRetVal)
  return tRetVal
end trim


Trims all forms of whitespace (CRs, spaces, tabs, etc.) from the beginning
and end of a text chunk.

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Chipp Walters
In reply to this post by Sivakatirswami
Katir,

If you wanted to do it in a repeat loop:

repeat with x = the number of lines in tFinalTranscript down to 1
   if line x of tFinalTranscript is "" then delete line x of
tFinalTranscript
end repeat

Sivakatirswami wrote:

> I'm missing something very simple here,
>
> Goal: delete empty lines beginning and end of text chunk
>
> ---------------
>
> put fld "transcript" into tFinalTranscript
>
> # clean up extra lines at beginning and end
>
> repeat while ((line 1 of tFinalTranscript) is empty)
>   delete line 1 of tFinalTranscript
> end repeat
>
> repeat until ((the last line of tFinalTranscript) is not empty)
>   delete the last line of  tFinalTranscript
> end repeat
>
> put tFinalTranscript
> exit to top
> ------------
> It still has all the empty lines top and bottom. If I globalize the  
> temp variable for a bit, then test the field or the variable from the  
> msg box:
>
> "line 1 of tFinalTranscript is empty"  returns true
> "the last line of fld "transcript" is empty" returns true
>
> But these handlers are not deleting the blank lines as expected..  what
> am I doing wrong? I don't think I need all those parentheses...  only
> added to try to get it to work... still doesn't
>
> TIA
> Sivakatirswami
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Dave Cragg
In reply to this post by Sivakatirswami
On 10 Aug 2005, at 02:17, Sivakatirswami wrote:

> I'm missing something very simple here,
>
> Goal: delete empty lines beginning and end of text chunk
>
> ---------------
>
> put fld "transcript" into tFinalTranscript
>
> # clean up extra lines at beginning and end
>
> repeat while ((line 1 of tFinalTranscript) is empty)
>   delete line 1 of tFinalTranscript
> end repeat

This part works here, with or without the parentheses.

Thoughts:
Are the leading lines really empty? For example, you don't have a  
crlf there instead of a normal return. Or possibly you have set a  
different lineDelimiter.


>
> repeat until ((the last line of tFinalTranscript) is not empty)
>   delete the last line of  tFinalTranscript
> end repeat

This may not do what you expect if the last char is a return.  
Although it displays as though there is a blank line, Rev will  
consider the last line to be the line before the final return. You  
could add this after the second loop:

   if char -1 of tFinalTranscript is return then delete char -1 of  
tFinalTranscript



Cheers
Dave
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Jon-3
In reply to this post by Ken Ray
Ken and Chipp are  being very helpful when they provide useful/working code, but I'm more curious about why the original code did not work.  It looked reasonable to me: the kind of code I might actually use some day, and get stuck on.

Any thoughts?

:)

Jon




On 8/9/05 8:17 PM, "Sivakatirswami" <[hidden email]> wrote:


>I'm missing something very simple here,
>
>Goal: delete empty lines beginning and end of text chunk
>  
>

Chipp Walters wrote:


 > Katir,
 >
 > If you wanted to do it in a repeat loop:
 >
 > repeat with x = the number of lines in tFinalTranscript down to 1
 >   if line x of tFinalTranscript is "" then delete line x of
tFinalTranscript
 > end repeat


Ken Ray wrote:

> Try this:
>
>function trim pWhat
>  local tRetVal
>  get matchText(pWhat, "(?s)^\s*(.*?)\s*$", tRetVal)
>  return tRetVal
>end trim
>
>
>Trims all forms of whitespace (CRs, spaces, tabs, etc.) from the beginning
>and end of a text chunk.
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Ken Ray
On 8/10/05 6:58 AM, "Jon" <[hidden email]> wrote:

> Ken and Chipp are  being very helpful when they provide useful/working code,
> but I'm more curious about why the original code did not work.  It looked
> reasonable to me: the kind of code I might actually use some day, and get
> stuck on.
>
> Any thoughts?

Thanks for posting this, Jon... it will help others as well. Here's the
stuff I found when I put (CR & CR & "This is a test" & CR & CR) into a field
and then ran the original code:

> put fld "transcript" into tFinalTranscript
>
> # clean up extra lines at beginning and end
>
> repeat while ((line 1 of tFinalTranscript) is empty)
>    delete line 1 of tFinalTranscript
> end repeat
>
> repeat until ((the last line of tFinalTranscript) is not empty)
>    delete the last line of  tFinalTranscript
> end repeat
>
> put tFinalTranscript
> exit to top


- It removed all the CRs from the beginning of the string
- I removed the only one of the CRs from the end of the string

Leaving me with:  "This is a test" & CR

As to why the original test seemed to leave what appeared to be CRs at the
beginning made me think that some other whitespace (space, tab, etc.) was on
the line which is why it couldn't be deleted.

As to why there were CRs left at the *end*, seemed to prove out in my test.
The reason is that when you delete the last line, that doesn't remove the
preceding CR which is at the end of the previous line. So you'll always end
up with a trailing CR (as I did).

This is why I proposed my Trim function, since it handles all these things.
However the original code would work, so long as:

1) You can be guaranteed that the leading/trailing whitespace is only CRs,
and

2) That you add the following line just before you do the "put":

if char -1 of tFinalTranscript = CR then delete char -1 of tFinalTranscript

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Dick Kriesel
In reply to this post by Ken Ray
On 8/9/05 7:36 PM, "Ken Ray" <[hidden email]> wrote:

> On 8/9/05 8:17 PM, "Sivakatirswami" <[hidden email]> wrote:
>
>> I'm missing something very simple here,
>>
>> Goal: delete empty lines beginning and end of text chunk
>
> Try this:
>
> function trim pWhat
>   local tRetVal
>   get matchText(pWhat, "(?s)^\s*(.*?)\s*$", tRetVal)
>   return tRetVal
> end trim
>
>
> Trims all forms of whitespace (CRs, spaces, tabs, etc.) from the beginning
> and end of a text chunk.

Or try the following if you want only to strip all occurrences of a
character, such as "return," from the beginning and/or ending of a string:

function strip pString,pSide,pChar
  if pString is not empty then
    put pString into tString
    if pChar is empty then put return into tChar
    else put pChar into tChar
    switch pSide
    case ""
    case "both"
      put strip(tString,"left",tChar) into tString
      put strip(tString,"right",tChar) into tString
      break
    case "left"
      repeat until char 1 of tString is not tChar
        delete char 1 of tString
      end repeat
      break
    case "right"
      repeat until char -1 of tString is not tChar
        delete char -1 of tString
      end repeat
      break
    end switch
    return tString
  end if
end strip


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Dick Kriesel
In reply to this post by Chipp Walters
On 8/9/05 8:22 PM, "Chipp Walters" <[hidden email]> wrote:

> If you wanted to do it in a repeat loop:
>
> repeat with x = the number of lines in tFinalTranscript down to 1
>    if line x of tFinalTranscript is "" then delete line x of
> tFinalTranscript
> end repeat

Or, if you wanted to delete all the empty lines without a repeat loop, you
could do as Jan Decroos suggested a year ago:

filter field "transcript" without empty


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

MichaelL-2
In reply to this post by Sivakatirswami
Tried this in the message box: put the number of lines in ("This is a
test" & CR)
=>1

The transcript does what it should. The confusion is that the CR is
part of the line that it ends, not the second line whose existence it
seems to imply.

At 11:03 PM -0500 10/8/05, Ken Ray wrote:

>Here's the
>stuff I found when I put (CR & CR & "This is a test" & CR & CR) into a field
>and then ran the original code:
>
>>  put fld "transcript" into tFinalTranscript
>>
>>  # clean up extra lines at beginning and end
>>
>>  repeat while ((line 1 of tFinalTranscript) is empty)
>>     delete line 1 of tFinalTranscript
>>  end repeat
>>
>>  repeat until ((the last line of tFinalTranscript) is not empty)
>>     delete the last line of  tFinalTranscript
>>  end repeat
>>
>>  put tFinalTranscript
>>  exit to top
>
>
>- It removed all the CRs from the beginning of the string
>- I removed the only one of the CRs from the end of the string
>
>Leaving me with:  "This is a test" & CR

--
Michael J. Lew

Senior Lecturer
Department of Pharmacology
The University of Melbourne
Parkville 3010
Victoria
Australia

Phone +613 8344 8304

**
New email address: [hidden email]
**
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Geoff Canyon
In reply to this post by Sivakatirswami
Others have answered the question of why your code might not be  
working. As to (possible) better methods, I like this one:

put word 1 to -1 of tString into tString

Note that this will also remove any leading whitespace on the first  
line that contains text, and any trailing whitespace on the final  
line that contains text, and any lines that contain only spaces or tabs.

gc

On Aug 9, 2005, at 6:17 PM, Sivakatirswami wrote:

> I'm missing something very simple here,
>
> Goal: delete empty lines beginning and end of text chunk
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: put word 1 to -1 of tString into tString -- staggeringly simple

Erik Hansen


--- Geoff Canyon <[hidden email]>
wrote:

> put word 1 to -1 of tString into tString

put word 1 to -1 of tString into tString  --
staggeringly simple.

Erik Hansen

[hidden email]    http://www.erikhansen.org

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: put word 1 to -1 of tString into tString -- staggeringly simple

Geoff Canyon

On Aug 11, 2005, at 11:32 PM, Erik Hansen wrote:

> --- Geoff Canyon <[hidden email]>
> wrote:
>
>
>> put word 1 to -1 of tString into tString
>>
>
> put word 1 to -1 of tString into tString  --
> staggeringly simple.

Yeah, I kind of like Transcript. ;-)
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Repeat until (0r "while") not working

Sivakatirswami
In reply to this post by Dave Cragg
Dave wins the prize for spotting my goof... I did have earlier in the  
handler (duh...)

   set the linedelimiter to "\"

So, I learned something, besides the several variations offered...

I moved the empty line cleanup outside the handler to a function:

main handler:

     put deleteEmptyLines(fld "transcript") into tFinalTranscript



function deleteEmptyLines tTranscript
   repeat while ((line 1 of tTranscript) is empty)
   delete line 1 of tTranscript
end repeat

repeat until ((the last line of tTranscript) is not empty)
   delete the last line of  tTranscript
end repeat

return tTranscript

end deleteEmptyLines

Interesting... even though the linedelimiter in the main handler is  
set to  "\"

Since the functions are independent... they respect CR as the line  
delimiter... and it works without having to reset the line delimiter  
in the main handler.

My goodness, how often I have in my scripts, changed delimiters mid-
handler... when probably I should be doing the "LISP" thing that we  
see here from time to time, and breaking out these routines into  
discreet functions.

Thanks

Sivakatirswami





On Aug 09, 2005, at 10:44 PM, Dave Cragg wrote:

> On 10 Aug 2005, at 02:17, Sivakatirswami wrote:
>
>
>> I'm missing something very simple here,
>>
>> Goal: delete empty lines beginning and end of text chunk
>>
>> ---------------
>>
>> put fld "transcript" into tFinalTranscript
>>
>> # clean up extra lines at beginning and end
>>
>> repeat while ((line 1 of tFinalTranscript) is empty)
>>   delete line 1 of tFinalTranscript
>> end repeat
>>
>
> This part works here, with or without the parentheses.
>
> Thoughts:
> Are the leading lines really empty? For example, you don't have a  
> crlf there instead of a normal return. Or possibly you have set a  
> different lineDelimiter.
>
>
>
>>
>> repeat until ((the last line of tFinalTranscript) is not empty)
>>   delete the last line of  tFinalTranscript
>> end repeat
>>
>
> This may not do what you expect if the last char is a return.  
> Although it displays as though there is a blank line, Rev will  
> consider the last line to be the line before the final return. You  
> could add this after the second loop:
>
>   if char -1 of tFinalTranscript is return then delete char -1 of  
> tFinalTranscript
>
>
>
> Cheers
> Dave
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: put word 1 to -1 of tString into tString -- staggeringly simple

Sivakatirswami
In reply to this post by Geoff Canyon
OK I just saw this... amazing... this solution leapfrogs the entire  
issue of line delimiters and required functions et al...

Sivakatirswami
On Aug 12, 2005, at 4:46 AM, Geoff Canyon wrote:

>
> On Aug 11, 2005, at 11:32 PM, Erik Hansen wrote:
>
>
>> --- Geoff Canyon <[hidden email]>
>> wrote:
>>
>>
>>
>>> put word 1 to -1 of tString into tString
>>>
>>>
>>
>> put word 1 to -1 of tString into tString  --
>> staggeringly simple.
>>
>
> Yeah, I kind of like Transcript. ;-)
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: put word 1 to -1 of tString into tString -- staggeringly simple

Ken Ray
On 8/13/05 12:35 AM, "Sivakatirswami" <[hidden email]> wrote:

> OK I just saw this... amazing... this solution leapfrogs the entire
> issue of line delimiters and required functions et al...

The only thing to keep in mind is the situation where you have hard-spaces
before or after a string, in which case the "word 1 to -1" approach won't
work. Admittedly, this is a extremely rare, but I just thought I should
mention it for those planning on using this solution.


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: put word 1 to -1 of tString into tString -- staggeringly simple

Sivakatirswami
What is the ASCII for a hard space and while the space might be  
retained, I do believe even with a  a hard space, the empty line(s)  
deletion at beginning and end of the entire text chunk would still be  
achieved (the original goal)

right?

skts


On Aug 13, 2005, at 8:19 AM, Ken Ray wrote:

> On 8/13/05 12:35 AM, "Sivakatirswami" <[hidden email]> wrote:
>
>
>> OK I just saw this... amazing... this solution leapfrogs the entire
>> issue of line delimiters and required functions et al...
>>
>
> The only thing to keep in mind is the situation where you have hard-
> spaces
> before or after a string, in which case the "word 1 to -1" approach  
> won't
> work. Admittedly, this is a extremely rare, but I just thought I  
> should
> mention it for those planning on using this solution.
>
>
> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: [hidden email]
>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

what is a hard space?

Erik Hansen
In reply to this post by Ken Ray


--- Ken Ray <[hidden email]> wrote:

> On 8/13/05 12:35 AM, "Sivakatirswami"
> <[hidden email]> wrote:

> The only thing to keep in mind is the situation
> where you have hard-spaces
> before or after a string, in which case the
> "word 1 to -1" approach won't
> work.

what is a hard space?

thanks,

Erik Hansen

[hidden email]    http://www.erikhansen.org


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: put word 1 to -1 of tString into tString -- staggeringly simple

Ken Ray
In reply to this post by Sivakatirswami
On 8/13/05 3:22 PM, "Sivakatirswami" <[hidden email]> wrote:

> What is the ASCII for a hard space and while the space might be
> retained, I do believe even with a  a hard space, the empty line(s)
> deletion at beginning and end of the entire text chunk would still be
> achieved (the original goal)
>
> right?

The ASCII value for a hard space is 202, and unfortunately the answer
depends on what you've got in your container. If you have:

(CR)
(spc)(CR)
Test1(CR)
Test2(CR)
(CR)
(spc)(CR)

when you do word 1 to -1 you get:

Test1(CR)
Test2

However, if the container is:

(CR)
(hardspc)(CR)
Test1(CR)
Test2(CR)
(CR)
(hardspc)(CR)

when you do word 1 to -1 you get:

(hardspc)CR
Test1(CR)
Test2(CR)
(hardspc)

This is why I use the regex expression for my "stsTrim" function instead of
"word 1 to -1"... it's not as elegant, but it *does* handle all the
situations.

function stsTrim pWhat
  local tRetVal
  get matchText(pWhat, "(?s)^\s*(.*?)\s*$", tRetVal)
  return tRetVal
end stsTrim

But if you know for sure that you won't be dealing with hard spaces, "word 1
to -1" is really elegant and easier to use I'd think.


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: what is a hard space?

Ken Ray
In reply to this post by Erik Hansen
On 8/13/05 6:21 PM, "Erik Hansen" <[hidden email]> wrote:

>
> --- Ken Ray <[hidden email]> wrote:
>
>> On 8/13/05 12:35 AM, "Sivakatirswami"
>> <[hidden email]> wrote:
>
>> The only thing to keep in mind is the situation
>> where you have hard-spaces
>> before or after a string, in which case the
>> "word 1 to -1" approach won't
>> work.
>
> what is a hard space?

A "hard space" is ASCII 202 (which on a Mac you can get by typing
Option-Space), which looks like a space, but acts like a non-space character
- that is, you can't break the words connected with hard spaces because it
"looks" (to the OS) like a single word.

Back in the old HC/SC days, you'd use hard spaces to make sure the
"clickText" could be used on what *appeared* to be two (or more) words in a
field. For example, if you have:

  Ken(spc)Ray(spc)coded(spc)here

in a locked field and the script of the field says "on mouseUp;put the
clickText;end mouseUp", when I click on "Ken", it will put "Ken". However,
if I have this in a field:

  Ken(hardspc)Ray(spc)coded(spc)here

and then clicked on "Ken", it will put "Ken Ray".

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: what is a hard space?

Richard Gaskin
Ken Ray wrote:
>>what is a hard space?
>
> A "hard space" is ASCII 202 (which on a Mac you can get by typing
> Option-Space), which looks like a space, but acts like a non-space character
> - that is, you can't break the words connected with hard spaces because it
> "looks" (to the OS) like a single word.

FWIW, a "hard space" is sometimes called a "non-breaking space" (in
reference to word breaks), and is represented in HTML and Rev's htmlText
with the character entity "&nbsp;".  If you're working with htmlText the
character entity can be easier to deal with than the ASCII value.

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
12