On Sun, 20 Jun 2021, at 15:57, Jeremy Nicoll wrote:

> So what would you do?  Suppose it'd not just three things
> that need to be exclued first but, say, twenty? 

Oops, sent that too soon.  I find it useful often, usually when 
validating things, eg:

select
   when words(f!ce_bfe) \== 1   then f!ce_err = "bfe '"f!ce_bfe"' not a single 
word"
   when \datatype(f!ce_ssn,"W") then f!ce_err = "ssn '"f!ce_ssn"' not a whole 
number"
   when \datatype(f!ce_ssx,"W") then f!ce_err = "ssx '"f!ce_ssx"' not a whole 
number"
   when \datatype(f!ce_wcn,"W") then f!ce_err = "wcn '"f!ce_wcn"' not a whole 
number"
   when \datatype(f!ce_wcx,"W") then f!ce_err = "wcx '"f!ce_wcx"' not a whole 
number"
   when \datatype(f!ce_wln,"W") then f!ce_err = "wln '"f!ce_wln"' not a whole 
number"
   when \datatype(f!ce_wlx,"W") then f!ce_err = "wlx '"f!ce_wlx"' not a whole 
number"
   when \datatype(f!ce_wld,"W") then f!ce_err = "wld '"f!ce_wld"' not a whole 
number"
   otherwise                         f!ce_err = ""
end
if f!ce_err \== "" then do
   f!ce_rettxt = f!ce_errpfx f!ce_err
   signal func_jn_chk_encp_z
end

(which is from a KEXX macro that's held in a library - ie a single file 
containing many
macro definitions.  The peculiar variable names - these all starting "f!ce_" - 
are used
so that when I'm editing the whole file and look for instances of where else a 
var is
used I can look for, eg, f!ce_<something> and not find vars used in the same 
way in
other macros in the same file.  That is, all the vars in that specific function 
have names
that start that way, different from vars in other functions in the same file.

The odd prefix also follows a naming convention I adopted according to whether 
the macro is one (as here) for a primary function I invented, or a utility one, 
or 
for a function that Kedit will invoke itself based on a keypress or a menu 
selection 
or a toolbar button click etc (where I don't get to choose the macro's name).))

-- 
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to