[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Dec 18 10:38:25 2003 
Subject:Re: Reading Input - arghh!! 
From:A . Sloman 
Volume-ID:1031218.09 

> Brilliant, many thanks for that, working much better now. Just one
> more small pointer would be appreciated :)
>
> I have a procedure taking an integer as input, which then uses
> rc_print_at to display that number at the appropriate position in an
> xwindow. However, rc_print_at flags an error saying it requires a
> string (rather than the integer). I know there's a command for
> converting string -> integer, but is there one that works in reverse?

The pop11 string concatenator >< takes any two objects and makes a
string out of them. The string contains the characters that would be
used to print them (using the current values of pr, pop_pr_quotes,
and the various class_print procedures for different datatypes.

So if you concatenate any object X with the empty string you'll get
a string that has the characters required to print X.

These two are equivalent

	'The number ' >< 999 >< ''

and

	'The number ' >< 999 >< nullstring

Both will produce a string like

	'The number 999'

except that ''

means
	create a new constant string (at compile time)

at point of code containing it, wheras "nullstring" is a pre-declared
identifier holding an empty string so it will not create a new one.

But the difference is not significant with modern cheap memories unless
you have a vast number of occurrences of ''

(Warning: if pop_pr_quotes is true (default is false) at the time you
use >< you'll get extra string quotes in the string created, since
pr produces them if pop_pr_quotes isnt' false.)

See also
	HELP STRINGS
	REF STRINGS

Aaron