[q-lang-users] where
Brought to you by:
agraef
From: Eddie R. <ed...@bm...> - 2006-10-05 14:44:48
|
Given the following script // strip character C from the left and right sides of a string strip C "" = ""; strip C S = strip C $ sub S 0 (N-1) if (S!N = C) where N = #S-1; = strip C $ sub S 1 N if (S!0 = C) where N = #S-1; = S otherwise; Is it possible to have another type of local variable defined at the end of a list of equations that would apply to all of them? For example, the "where N = #S-1" is on both lines. This is not a good example, but what if I have a list five or more equations, the same where clause on each line seems a waste of typing. I understand that "where" should apply to the equation that it corresponds to instead of all of them because you might not want the local variable apply to the other equations in the list. I know a where clause could be applied to cond, case, and if then else. Eddie |