Be careful Bruce,

CHAR(255) worked as a hard space in DOS (ASCII character set), but with the 
usual Windows ANSI character set it’s CHAR(160).

If you type [Alt]255 at the R>, CHAR(160) is generated. To type CHAR(x), press 
[Alt]0x, for example, [Alt]0255. In Windows, CHAR(255) is “y” with an umlaut 
(ÿ).

Try this: At the R>, type:

SET VAR X TEXT='

Then, press [Alt]255, the single quote and [Enter].

Now enter this command:

SET VAR N=(ICHAR(.X))

The value of N should be 160.


Regards,

Stephen Markson
The Pharmacy Examining Board of Canada
416.979.2431 x251

From: [email protected] [mailto:[email protected]] On Behalf Of Bruce Chitiea
Sent: Sunday, April 22, 2012 8:20 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: null

Mike(s):

I haven't experimented with R:Base yet, but I've used [Alt-255] for years to 
force 'hard' spaces where 'soft' spaces get stripped or ignored.

Bruce


-------- Original Message --------
Subject: [RBASE-L] - Re: null
From: "Mike Byerley" <[email protected]<mailto:[email protected]>>
Date: Sun, April 22, 2012 12:41 pm
To: [email protected]<mailto:[email protected]> (RBASE-L Mailing List)

I wish RBase would treat [Space] with the respect it deserves.. ;-)

Really, if you wish a string to have a trailing space, it should have one.
The Trim functions (Trim, LTrim, RTrim) are purpose bent for the user to use
them as appropriate.



----- Original Message -----
From: "Bruce Chitiea" <[email protected]<mailto:[email protected]>>
To: "RBASE-L Mailing List" <[email protected]<mailto:[email protected]>>
Sent: Sunday, April 22, 2012 2:13 PM
Subject: [RBASE-L] - Re: null


Mike:

Mike Byerley's got your answers.

But more conceptually, nulls, blanks and spaces are apples, oranges and
bananas.

'Null' literally means 'no value', which might have several meanings:

a) There may be a value for this field out there, but we just don't know
it (and may never know);
b) There may be NO value for this field out there, but we don't know
that either;
c) There's NO value which makes sense in this field (in this
particularly usage of the data).

The formal relational model calls for the introduction of a special,
reserved marker to represent fields which contain 'no value'. In R:Base,
this is the string '-0-'. R:Base allows the user to introduce a
character or string to represent nulls; a freedom with risk.

The introduction of the semantic term 'blank' is what's tripping you up.

We think of 'blank' as meaning 'no value'; and a 'space' as a
representation of 'blank'. In a word processing context, this is right
and proper. But a 'space' is an actual value: ASCII 32; so within a a
database context, using a 'space' to represent 'blank' to represent
'null' introduces a value where there should be none; thus defeating the
very purpose of 'null'.

To represent nulls in reports (using the R:Base report designer), you
can change the printed representation of nulls to the 'space' without
doing violence to null protection:

From R:Base help:

1. [Right-click] on the column object whose nulls you wish to represent;
2. From the drop-down menu, select 'NULL Format:'
3. Enter the string (which just might be an ASCII 32 space) you wish to
print in the place of '-0-'

A disquieting snippet from R:Base help:

"If you set null to a blank space, R:BASE does not display rows
composed entirely of nulls with the SELECT command."

I take that to mean that a select would return rows with NULLs and
spaces, which might have a meaning totally out of sync with what you
intend.

Hope this helps, and Cheers,

Bruce

-------- Original Message --------
Subject: [RBASE-L] - Re: null
From: "Mike Byerley" <[email protected]<mailto:[email protected]>>
Date: Sat, April 21, 2012 1:47 pm
To: [email protected]<mailto:[email protected]> (RBASE-L Mailing List)

Mike,
Try this and see what the results are before you set null to ' '
If you are expecting null to be a space, you will be disappointed.

SET VAR vemptyspace TEXT = ''
SET VAR vspace TEXT = ' '
SET VAR vblank TEXT = (CHAR(32))

SET VAR vtest TEXT = ('RBASE' + .vemptyspace + 'ROCKS')
PAUSE 2 USING .vtest
SET VAR vtest TEXT = ('RBASE' + .vspace + 'ROCKS')
PAUSE 2 USING .vtest

SET VAR vtest TEXT = ('RBASE' + .vblank + 'ROCKS')
PAUSE 2 USING .vtest

RETURN

If you want null to be just invisible for display purposes (devoid of
the -0- in fields that are nulls) then set the null character to an
unprintable ascii value like Char(160)

It has been recommended practice for as long as I can remember to set
null
to -0- before unloading data.

you can set null to that value by the recommended method of:

set null '-0-'

At the start of an RBase session, I include this:

set null '-0-'
set var vHoldNull = (CVAL('NULL'))

then at the conclusion of the session:

set null .vHoldNull

Then if the session ends back in RBase RDBMS interface, my null setting
is
back to the recommended setting for unload. I don't change the null
setting
to do ReLoad FWIW.

In your examples, you had null set to Two blanks and Three blanks, but
it
doesn't matter, since RBase strips out blanks in an expression as my
example
shows.


----- Original Message -----
From: "mike epstein sony viao office" 
<[email protected]<mailto:[email protected]>>
To: "RBASE-L Mailing List" <[email protected]<mailto:[email protected]>>
Sent: Saturday, April 21, 2012 3:28 PM
Subject: [RBASE-L] - null


: Can anyone clarify the meaning, and usage of
:
:
:
:
:
: Set null ' '
:
:
:
: Set null -0-
:
:
:
: Set var <varname> <vartype> = null
:
:
:
: Does the Set var <varname> <vartype> = null make a variable that has a
: value, change it to ' ' (blank)
:
:
:
:
:
: On a network with 2 workstations Is the setting on the local computers
cfg
: file affected by changes in an eep , say that sets null to -0- inserts

or
: updates into a table and then before exiting the eep sets null = ' '.
:
:
:
:
:
: Should the -0- only be used to unload data and structure from a table?
:
: Should the -0- only be used to reload or pack the database ?
:
:
:
: I have set null in the configuration setting to blank from -0- , when
I
: close the configuration settings I get an error message that says '
cannot
: save c:\windows\rbengine91_64.cfg. It does not matter if I change the
order
: ie -0- to blank
:
: Either way whatever symbol is input into the null configuration
setting
is
: the setting in the application
:
:
:
: I am also experiencing that the -0- all of the sudden appears when the
: application is run while tracing with no change in the ' ' setting by
the
: program
:
:
:
:
:
:
:
:
:
:

Reply via email to