Page 3 of 3

Re: new functions: :chr, :asc, :asciiMap

Posted: 22 May 2011 15:59
by dbenham
I discovered and fixed a bug in both :asc and :str2hex functions. The functions were failing if the input StrVar name collided with a local function variable.

The new version is available at Google Sites: dbenham Files

Re: new functions: :chr, :asc, :asciiMap

Posted: 23 May 2011 19:39
by dbenham
Fixed bug in :chr, :hex2str and :rot13 relating to [Solved] Return ANY string across ENDLOCAL boundry - BUG!

Updated code available at the same place as last time.

Dave Benham

Re: new functions: :chr, :asc, :asciiMap

Posted: 12 Oct 2023 14:54
by FordPerfect
Google site doesn't exist anymore. Archive.org check failed. :(

Anyone got the most recent file / version of the script...?

Re: new functions: :chr, :asc, :asciiMap

Posted: 27 Oct 2023 11:02
by einstein1969
look if this is valid...

Re: new functions: :chr, :asc, :asciiMap

Posted: 28 Oct 2023 12:57
by Joe Caverly
Found this on Github...

Code: Select all

::  CharLib.bat is a callable library of batch functions used to interconvert
::  between characters and numeric ASCII code values.
::
::  syntax:
::
::    [call] [path]CharLib function [arguments]
::
::  For a full list of available functions use:
::
::     CharLib help
::
::  For detailed help on a specific function use:
::
::     CharLib help FunctionName
::
::  All library functions give the correct result regardless whether delayed
::  expansion is enabled or disabled at the time of the call!
::
::  The following variables are reserved for this library and should only be
::  populated via a call to initLib:  ASCII_10, ASCII_13, ASCII_26
::
::  Some code and many coding techniques are from www.dostips.com
::  The rest is original work by Dave Benham
::  Special thanks and much credit to www.dostips.com member Jeb for providing
::  numerous techniques to deal with problematic non-printable characters, the
::  original idea to use !map:#%%c=! as a fast lookup mechanism for :asc
::  and :str2hex, and most importantly for incredible coding techniques to
::  facilitate return of ANY string across a function endlocal boundry,
::  even if the function was called while delayed expansion was enabled.
https://github.com/ApexDevelopment/tiny ... harLib.bat

Joe

Re: new functions: :chr, :asc, :asciiMap

Posted: 04 Nov 2023 04:54
by FordPerfect
That's very kind of you, thanks.

In the meantime I started my own version and used the old basic idea.
I have the individual characters in an array, which is working well so far (I think).

Funny, I forgot the beep char and I was wondering, man, where does that come from? ;)