How do you break long strings without getting a space in variables?

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

How do you break long strings without getting a space in variables?

Jason Martin
/* The last token was a hyphen.
 In this case the hyphen is functionally replaced by a blank, and
hence acts as a continuation character. */

/* - the escape sequence represents a “null” character (the character whose
     encoding equals zero),
     used to indicate continuation in a say instruction */

/* Or how to break long strings without the added space */

name = 'Jason' -
       'Martin'

/* or space after -*/

program_name = 'Net'-
       'Rexx'

say 'good' -
'night'

say name

say program_name



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How do you break long strings without getting a spacein variables?

Mike Cowlishaw
Try:
 
name = 'Jason' -
  || 'Martin'


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How do you break long strings without getting a space in variables?

Jason Martin
In reply to this post by Jason Martin
Sorry, just tired again.

On Wed, Sep 19, 2012 at 7:16 AM, Jason Martin <[hidden email]> wrote:
/* The last token was a hyphen.
 In this case the hyphen is functionally replaced by a blank, and
hence acts as a continuation character. */

/* - the escape sequence represents a “null” character (the character whose
     encoding equals zero),
     used to indicate continuation in a say instruction */

/* Or how to break long strings without the added space */

name = 'Jason' -
       'Martin'

/* or space after -*/

program_name = 'Net'-
       'Rexx'

say 'good' -
'night'

say name

say program_name




_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How do you break long strings without getting a space in variables?

Jeff Hennick
Jason,

You use the concatenation operator:  ||  It "swallows" the blanks on each side of it.

name = 'Jason' -
       || 'Martin'

or

name = 'Jason' || -
       'Martin'

But in this case you probably want a single space between the two strings.  Put it either in one of the strings or concatenate a third string consisting of a single space.

On 9/19/2012 12:56 PM, Jason Martin wrote:
Sorry, just tired again.

On Wed, Sep 19, 2012 at 7:16 AM, Jason Martin <[hidden email]> wrote:
/* The last token was a hyphen.
 In this case the hyphen is functionally replaced by a blank, and
hence acts as a continuation character. */

/* - the escape sequence represents a “null” character (the character whose
     encoding equals zero),
     used to indicate continuation in a say instruction */

/* Or how to break long strings without the added space */

name = 'Jason' -
       'Martin'


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How do you break long strings without getting a space in variables?

alansam


On 19 September 2012 10:59, Jeff Hennick <[hidden email]> wrote:
Jason,

You use the concatenation operator:  ||  It "swallows" the blanks on each side of it.


name = 'Jason' -
       || 'Martin'

or

name = 'Jason' || -
       'Martin'

But in this case you probably want a single space between the two strings.  Put it either in one of the strings or concatenate a third string consisting of a single space. 

It needn't be that complicated; the continued line without concat will automatically generate a single space.

name = ''
name[0] = 2
name[1] = 'Jason'       -
          'Martin'
name[2] = 'Jason'       -
       || 'Martin'

loop nn = 1 to name[0]
  say name[nn]
  end nn

yeilds:

Jason Martin 
JasonMartin 

A.

--
Can't tweet, won't tweet!

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Alan

--
Needs more cowbell.
Reply | Threaded
Open this post in threaded view
|

Re: How do you break long strings without getting a space in variables?

Jason Martin
In reply to this post by Jason Martin

Thanks again everbody,

1) I was trying to squeeze as much data into "ONE" class without breaking Java 64K class file limit.

2) I know that's a bad thing and not good coding but I have my reasons for this project.

3) I got to the point of even trying to cheat NetRexx

4) Then you just get tired and confused

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How do you break long strings without getting a space in variables?

Jason Martin
In reply to this post by Jason Martin
I did learn that NetRexx parse can be quite a powerful tool without confusing regular expression syntax in this project.

And it saved me a lot of space without creating arrays or indexed strings.

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How do you break long strings without getting a space in variables?

ThSITC
In reply to this post by Jason Martin
Hi Jason,
    as far as I do know you shall use the *concatenation operator' (||) in this case *before the hyphen*, e.g:

name = 'Jason ' || -
      'Martin'

I think that the Java Compiler (or even NetRexx ??) shall *optimize* the two concatenated literals*
into *one*, but am *not 100 % sure* about this....

Thomas.
-------------------------------------------------------------------------------------------------------------------------------------
PS: I have been offline the past week, so still 1320 mails pending for reading & reply (when necessary) ...

PPS: Will get my last 6 teeth extracted tomorrow, and get the 32 Third teeth then, as well,
and do hope I can then smile again without shame (as usual, but did it meanwhile, as well,
as I am not shy at all (as you all do know by now <grin<)
==========================================================================
Am 19.09.2012 13:16, schrieb Jason Martin:
/* The last token was a hyphen.
 In this case the hyphen is functionally replaced by a blank, and
hence acts as a continuation character. */

/* - the escape sequence represents a “null” character (the character whose
     encoding equals zero),
     used to indicate continuation in a say instruction */

/* Or how to break long strings without the added space */

name = 'Jason' -
       'Martin'

/* or space after -*/

program_name = 'Net'-
       'Rexx'

say 'good' -
'night'

say name

say program_name




_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



--
Thomas Schneider CEO ThSITC IT Consulting KG Erdbergstr. 52-60/1/13 1030 Wien http://www.thsitc.com Austria, Europe Skype ID: Thomas.Schneider.Wien Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com