CompuServe Thread

ArexxHelp

3 messages in this thread
#12397From: Tom HannonJul 23, 1991 12:01 PM
I'm writing a checkbook program in Arexx. The following line will write the "pull"ed data to the logical file 'chkput'. writeln('chkput',chk#' 'amt' 'desc' 'date) In another section of the program I want to be able to display the data to the screen. The problem is that the data it is offset since amounts and descriptions will obviously be different lengths. How can I display the data so it will be columnized.? I would also like to say that I appreciate the help I am getting so far. I am relatively new to Arexx and am in no way an advanced programmer so if these questions seem simple please bear with me. Thanks Tom
#12449From: BILL LEACHJul 24, 1991 4:01 PM
I won't say that it is necessarily the best way but…. you can create a string of spaces and then overlay the appropriate locations. If you want to overlay the amount so that the decimal points line up then do something like "overlay(amt,spaces,<start location>+lenght(amt)-2,,' ')"
#12486From: Martin WarnettJul 25, 1991 11:01 AM
Tom: I think what you're looking for is the left function. left(chk#, 10) will return a string that is always 10 bytes long. If the value of chk# is less than 10 bytes long it will be padded on the right, (note the ARexx manual is wrong on page 60, look at the example not the text), with spaces, or any other character you choose. If chk# contains 1001 then: left(chk#, 6, '*') returns 1001** -=Martin=- – via Whap!