× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Rory

Are you referring to the MOVE operation? I don't know that I've used one in years, at least on purpose.

Everything I've done with varying variables is in free-form or EVAL statements. I've never tried a MOVE varying to fixed, so I just tried it. Here's the code, where I put a shorter value into a varying field that already has a value:

D fixedvar S 10A

D varyingvar S 10A VARYING
D INZ('abcdefghij')

c move varyingvar fixedvar

c reset fixedvar
c movel varyingvar fixedvar

c eval varyingvar = 'abcde'
c reset fixedvar
c move varyingvar fixedvar
c
c reset fixedvar
c movel varyingvar fixedvar

c eval *inlr = *on

Run it in debug, if green-screen, use EVAL FIXEDVAR:X to see the value in hex.

Vern

On 2/22/2013 5:30 PM, Rory Hewitt wrote:
Scott,

This isn't the first poster who has expressed concern about whether a move
from a varying string to a fixed string will cause problems somehow. It's
just an 'education' thing - if people are used to working with fixed
strings, they may just be wary of spending the time to figure out the
benefits of varying strings. Better the devil you know and all that.

Rory


On Fri, Feb 22, 2013 at 2:43 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>wrote:

IMHO, varying strings are much more elegant to work with. Even if it
doesn't save any CPU cycles, it just makes your code easier to write.

What's the advantage to sticking with fixed-length strings?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.