ARG_VAL(1)
Posted in 1995
K> Date: Fri, 9 Jun 1995 15:46:45 -0400 K> We have a common function that uses arg_val(1). For one particular program > we'd like to change the value returned from arg_val(1) so that the > common function does something else, this way we don't need to change the > common function. OK, maybe it's just that it's getting late, but I don't understand. Tell me if I'm off here: Your common function that uses arg_val(1) is in a library that you are always compiling into every program, and you don't want to have to modify it because then you'd have to recompile every program (to ensure compatibility, etc.)? You want to handle a different value for arg_val(1) than you ever have in any existing program, and don't anticipate needing that value for any other program. I have an idea if this is the case, but whether it works depends on what the library function does. What happens if the library function sees a value of arg_val(1) that it doesn't expect? (i.e., what you are planning to pass for this "unique" program? If it simply ignores the arg_val and returns control back to the program, then you can have code like this: # begin standard code ...do program processing ...call std arg_val handler call custom_arg_val_handler ...continue standard code All you have to do is create a function to handle the custom arg_val(1) and call it right after you call the standard arg_val handler, or before other code expects to use it. The drawback to this is that you've created redundant code, and if there's any chance that you'd use this for something else, then you've increased future maintenance. It might be best to "bite the bullet" and integrate this into the standard handler. Tim --- ~ SPEED 1.40 [NR] ~