× 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.



>From: "Phil" <sublime78ska@yahoo.com>
>Date: Tue, 1 Jan 2002 11:17:50 -0500
>
>I am wanting to convert a pgm to use /FREE.  Can I move a character field
to
>a data structure with an OPCODE other than MOVE?  What about moving a
>character to a packed field.

Phil, a data structure is also a character field, so you can use EVAL.  Or
use EVALR, if the data structure has a different length from the character
field.

To move a character to a packed field, there's no straightforward solution.
If the character field ever has "negative" numeric data or implied decimal
points, say '1234M', then you should defined a zoned overlay for your
character field and assign from the zoned overlay.  If your numeric data
is always positive, calling 'atoi' will work as long as the data isn't too
long (9-10 digit limit).  'atoll' is better, with a limit of about 18
digits.
(Search the archives for 'atoi'.  If you want to use 'atoll', it's
identical
to 'atoi', but it returns 20i 0.)

There may be better support for character-to-numeric in the future, but I
doubt that it will handle the cases where you MOVE '1234M' and get -12345,
nor the cases where you MOVE '12345' to -987654321 and get -987612345.
Not that anyone actually has any code that does this :)

Barbara Morris



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.