Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDFORM

SDFORM.m

Go to the documentation of this file.
  1. SDFORM ;IOFO BAY PINES/ESW - FORMAT MESSAGES ;09/02/2004 2:10 PM [5/19/05 8:24am]
  1. ;;5.3;Scheduling;**327**;Aug 13, 1993
  1. ;This routine may be called to format a text up to four columns.
  1. ;The returned value may be asigned to an array element used in
  1. ;a message creation
  1. ;================================================
  1. FORM(FIRST,FN,SECOND,SN,THIRD,TN,FOURTH,FRN) ;
  1. ;
  1. ;FIRST,SECOND,THIRD,FOURTH - names of variables containing text values or text strings
  1. ; to be included in a formatted message
  1. ;FN,SN,TN - numbers assigned for a text and spaces up to the next column
  1. ;
  1. ;Output: formatted text
  1. ;
  1. N FS,SS,TS,FNS,SNS,TNS
  1. S:'$D(THIRD) THIRD=""
  1. S:'$D(FOURTH) FOURTH=""
  1. S:'$D(TN) TN=""
  1. S:'$D(SN) SN=""
  1. S:'$D(FRN) FRN=""
  1. S FNS=FN-$L(FIRST) S:FNS'>0 FNS=1,FIRST=$E(FIRST,1,$L(FIRST)-1) S $P(FS," ",FNS)=""
  1. S SNS=SN-$L(SECOND) S:SNS'>0 SNS=1,SECOND=$E(SECOND,1,$L(SECOND)-1) S $P(SS," ",SNS)=""
  1. S TNS=TN-$L(THIRD) S:TNS'>0 TNS=1,THIRD=$E(THIRD,1,$L(THIRD)-1) S $P(TS," ",TNS)=""
  1. Q FIRST_FS_SECOND_SS_THIRD_TS_FOURTH