Change needed to ^%ZOSF("SIZE")

Bug #616111 reported by Kevin Toppenberg
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Astronaut VistA Servers
New
Undecided
Unassigned

Bug Description

Change needed:

From this:
   ^%ZOSF("SIZE") = S Y=0 F I=1:1 S %=$T(+I) Q:%="" S Y=Y+$L(%)+2 ; <=====

  To This:
   ^%ZOSF("SIZE") = S Y=0 F I=1:1 S %=$T(+I^@X) Q:%="" S Y=Y+$L(%)+1 ; <=====

  This is to make the code compatible with GT.M

  (Thanks to Jim Self for this tip)

Revision history for this message
bhaskar (bhaskar) wrote :

A suggested alternative implementation is attached.

Revision history for this message
bhaskar (bhaskar) wrote :

Arrgh! Those who write code are doomed to improve it!!! And those who use GT.M are doomed to finding alternative (and even occasionally better) ways of doing things.

Here is a slightly simpler and more efficient setexample.m that uses $STACK() rather than ZSHOW:"S" into a local variable.

Also, someone pointed out to me that on some platforms, ls -l on some Linuxes may use multiple spaces, and consequently the use of $PIECE() to get the size is not that robust. So, I am attaching a new utility program _MPIECE.m (like $PIECE() but which treats multiple occurrences of the separator as a single occurrence).

I make no claim of copyright to sizeexample.m (i.e., please consider it to be an example of code in the public domain). As _MPIECE.m is intended to eventually go into a GT.M release, it has the standard FIS copyright for GT.M utility programs, and is provided here under the terms of the GNU Affero General Public License version 3 (http://www.gnu.org/licenses/agpl.txt).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.