Re: Right justify
Posted in 1999
Thanks for repsponding but... I need the function to be generic for variable length strings (MAX char(100)). Example: define g_8 char(8), g_50 char(50) let g_8 = rightshift("123456 ") # Will return " 1234" (four spaces,"1234") # I need it to return " 123456" (two spaces,"123456") let g_50 = rightshift("123456 ") # Will also return " 1234" (four spaces,"1234") # I need it to return " 123456" (forty-four spaces,"123456") Paul Roberts wrote in message <7f7pa0$3bo1@webint.na.informix.com>... >In article <7f7hm9$l83$1@news.monmouth.com>, >Like this, maybe? > > function rightshift(a_string) > > define a_string, ret_val char(10) > define i smallint > > let i = length(a_string) > let ret_val = (10-i) spaces, a_string clipped > return ret_val > > end function { rightshift }