Help examples for the @ISxxx functions

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
Whilst investing Steve's feature request, I tried to write a simple @CLASS
function that would return the type of the string using Steve's criteria.
I was surprised to find that a string of a floating point number was not
identified as numeric.

So I went to the help file under @ISDIGIT and @ISALNUM. Each one has
three examples listed. In the case of @ISDIGIT:


echo %@isdigit[0]
echo %@isdigit[123.456]
echo %@isdigit[-123]

Only the first example returns 1. The other two return 0. Based on the
description, that makes sense (ex 2 contains a period and ex 3 contains a
dash). However, it might be nice if the examples showed the expected
results and explained why.

I don't know what the intent of these functions are. If it's for parsing
purposes, then I think I'd be more interested in whether the string is
numeric as opposed to all the digits being numbers. Otherwise, if I'm
only looking at single characters and testing what that individual
character is, then I'd only want to look at the first character of a
string.

Mind you, based on the fact that I probably haven't used these functions
before, it's not all that big a deal to me.

-Scott
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
Well, there you go then. I don't what you're always complaining about. ;)
-Scott





Quote:

> I don't know what the intent of these functions are. If it's for
> parsing purposes, then I think I'd be more interested in whether
> the string is numeric as opposed to all the digits being numbers.
Which is why there's a @NUMERIC[] function.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
From: samintz
...
| I don't know what the intent of these functions are. If it's for parsing
| purposes, then I think I'd be more interested in whether the string is
| numeric as opposed to all the digits being numbers. Otherwise, if I'm
| only looking at single characters and testing what that individual
| character is, then I'd only want to look at the first character of a
| string.

First, I appreciate your interest in my request. However, the issue came up when I revised one of my batch programs whose input string or strings are represenatations of keyboard keys that can be used as desktop hotkeys (when combined with modifiers, such as alt-ctrl-shift). My earlier version required a single string to contain only numbers, or only letters, or the label of a single function-key (F1 ... F12). It collects all keys in a single set before creating a sorted report. Today I enhanced it so all key labels can be combined into a single string, and had many IFF/ELSEIFF and SWITCH statements. There remains some ambiguity - F followed by a digit or two is considered a function key label if valid, so F1 is not equivalent to 1F (the former reports about a function key, the latter about keys F and 1). So indeed my application parses, but its domain does not include all numerics.

Rex:
On the help page for @NUMERIC you should add btw. the heading "Examples" and the table of examples that it assumes the US convention for decimal separator (period .) and thousands separator (comma ,).
--
Steve
 
Similar threads
Thread starter Title Forum Replies Date
C Add link to ewriter help to program group... Support 3
samintz How to? Search for %(command) in Help? Support 1
Joe Caverly Favorites in eWriter Help Support 6
Joe Caverly Quick Search in eWriter Help Support 1
vefatica Online help? Support 2
fishman@panix.com HELP!! I just updated to Version 28 and as usual I cannot make extended directory search work. Support 2
JohnQSmith New online help file wrong logo Support 7
Jay Sage Documentation Function @DRIVE Missing in Help Lists Support 0
Charles Dye More help nits Support 0
D Documentation Typo in COPY help Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
Joe Caverly Documentation COMMANDS in Version 27 help Support 8
K_Meinhard How to? Help window position Support 7
U Command help on file names Support 5
D Documentation Help "Startup" page does not describe global lists Support 0
vefatica Help disappears? Support 6
rchapmanitt Help Purchasing Support 2
Charles Dye Documentation Help nits: @ZIPFILECRC Support 0
C version help Support 3
C Documentation Help Nit. REN / RENAME Support 0
Dmitry L. Kobyakov Documentation Error in the Help: the WINDOW command Support 0
vefatica Help for @PID Support 2
vefatica Need help with XML Support 3
Alpengreis Documentation Minor issue in help file for view /E Support 1
R Documentation Advanced Directives Help Support 0
R Documentation Help Nit with SETP Support 0
R wmic command help Support 9
R Documentation Help Nit > bdebugger View Menu Support 0
R Documentation A couple of Help nits Support 0
R Documentation Help typo Support 1
MikeBaas How to? I need help with RD Support 5
R Documentation v25 Help Comments Support 1
Joe Caverly DIRectory Colorization in v25 Help File Support 0
vefatica Help nit Support 0
D error in help documentation? Support 0
Joe Caverly _EXPANSION in help file Support 0
K_Meinhard Help file error Support 1
Joe Caverly JOBMONITOR in Help File Support 1
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
D The local HELP viewer... Support 0
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
C Documentation Help nix ZIP /M Support 0
Joe Caverly v24 Help File - DATEMONITOR Support 1
Joe Caverly 7zip command links to zip help Support 0
K_Meinhard Help problems Support 3
Charles Dye Documentation Help Nits Forever: Checksum functions Support 0
Joe Caverly SAVECONSOLE in Help File Support 0
Joe Caverly CMDebug v23 Help: /FEEDBACK /UPDATE Support 0
Joe Caverly CMDebug v23 Help: Link to MOUNTVHD goes to MOUNTISO in UNMOUNTVHD Support 0
Joe Caverly Help not launching in CMDebug v23.00.14 x64 Support 1

Similar threads