Rebol Talk Forum  |  Getting Started  |  Code Examples, Tips & Advice  |  Topic: Testing a single characetr variable for equality to space or .....
Pages: [1] Print
Author Topic: Testing a single characetr variable for equality to space or .....  (Read 612 times)
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
Testing a single characetr variable for equality to space or .....
« on: January 24, 2007, 08:47:42 PM »

The single line below seems to work in checking a single character from a record read in thru a port (rec1) for being greater than a space character.

if ((substr rec1 (y + j) + 2054 1) > " ")


When I used single quotes instead of double quotes Rebol objected.

I thought single quotes properly 'defined' a single character...... which seems comparable to the size and nature of the character defined on the left of the 'greater than' sign ........ yet Rebol seems to want a 'string' of length 1 instead.

Why's that ?
Logged
rebolek
Newbie
*
Offline Offline

Posts: 17


View Profile
Re: Testing a single characetr variable for equality to space or .....
« Reply #1 on: January 25, 2007, 05:23:39 AM »

no, single character is defined like this: #"a"
you can't use 'a' in REBOL. single quote is for literal value as in 'a.
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Code Examples, Tips & Advice  |  Topic: Testing a single characetr variable for equality to space or .....
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 17, 2008, 05:55:09 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2169 Posts in 562 Topics by 1224 Members
Latest Member: thyptoste

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc