[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

3-byte char. and left-parsing



Wow, Carl, that's really elegant and well-thought-out. We have a routine in
the Menus/Dialogs that does left or right substrings by length, using
wildcard X and a count of string length. Basically, it splits off the left
of the string regardless -- but for right substrings it just does a
subtraction. So, to get the last 3 characters off a string (as when you want
to strip off a file extension and add one of your own), you just take
(stringlength - 3) and pop it off the left of the string. The routines are
called (duh) LeftString and RightString. I see my co-conspirator, Lucas,
re-coded the routines with the undocumented CU - LB count-up thing that loads
S/G 46 with wild-X's up to the number stored in S/G 45. Pretty neat way to
avoid a loop, but I suspect that the XyWrite internals do the same thing
(Dave E. -- do you ever read this stuff? Can you confirm or deny?). Also has
the (indocumented, I think) VA| -- va pipe symbol -- to get the size of a
S/G. The input string goes in as S/G 40 and comes out (in both routines) as
S/G 41 for the left portion and S/G 42 for the right portion.

Anyhow, for those who use menus or want to hack these routines into their
programs, there they are.

Tim Baehr
tbaehr@xxxxxxxx