[ipxe-devel] inc command - iterating with characters?

Christian Hesse list at eworm.de
Tue Aug 13 08:35:13 UTC 2013


"Michael Brown" <mbrown at fensystems.co.uk> on Fri, 2013/08/02 12:45:
> > On 02.08.2013 11:27, Christian Hesse wrote:
> >> just saw the last commit about inc command... Really great work!
> 
> Thanks!
> 
> >> Now I think about a dynamically generated menu that automatically
> >> increments
> >> the key shortcuts. However I do have a menu that has more than ten
> >> entries, so iterating with characters (e. g. 1, 2, ..., 9, a, b, ...)
> >> would
> >> be a great feature. Is there a way to do that already?
> >> Any chance to get that implemented?
> >
> > iPXE> set x:uint8 65
> > iPXE> show x:string
> > x:string = A
> > iPXE> echo ${x:string}
> > A
> 
> The "item --key <key>" option accepts either single-character literals
> (e.g. "1") or numeric ASCII values (e.g. "97" for "a").  You could
> therefore do something like:

Using numeric ASCII values does the trick for me. Works like a charm.
Thanks a lot!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20130813/e74429a2/attachment.sig>


More information about the ipxe-devel mailing list