|
Mike, it sounds like the only reason you are using an array is for doing this operation - something that is no longer needed in rpgiv with the new string handling bifs. You could do your string replacements with them instead. try something like this: - I could be wrong on %size() - might be %len().. eval $x = %scan('*':field) eval $y = %size(field)-$x eval %substr(field:$x+1:$y) = *all'X' rick --original message-- Mike said: <snip> I'm trying to format a field for display on the screen -- if the user enters a value that contains an asterisk, I want to fill out the field with asterisks after that position before it's displayed again. This is motivated as much by trying to make things really clear for fumble-fingered users as any other real "need" to go this route, but in this situation it seems to work pretty well. Right now, I just define an array overlaying the field, search for an asterisk in the field, and then do MOVEA on the array. To me, this seems, well, just a whole lot slicker than the "for" loop. I admit that cryptic code sometimes is hard to understand, but as a former DIBOL and VB programmer I have come to appreciate some of the brevity that RPG/400 offered. (At the same time, I _really_ missed some of the features of those other languages that we didn't get until RPG IV -- that was (is) a great enhancement, and I love it. But I still like using MOVEs to put characters into decimal fields and vice versa -- I know I could use data structures or atol() or %EDITC, but MOVE is simple, and it works. And now I have this MOVEA thing. . .)
As an Amazon Associate we earn from qualifying purchases.
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.