help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I convert hex numbers to decimal ?


From: bolega
Subject: Re: How do I convert hex numbers to decimal ?
Date: Sun, 6 Sep 2009 22:52:02 -0700 (PDT)
User-agent: G2/1.0

On Sep 6, 7:56 pm, Eli Zaretskii <e...@gnu.org> wrote:
> > From: bolega <gnuist...@gmail.com>
> > Date: Sun, 6 Sep 2009 18:03:57 -0700 (PDT)
> > Cc: gnuist...@gmail.com


Thanks for your reply but my questions remain and I explain better
this time.

>
> > 1) How do I convert hex numbers to decimal ?
>
> I presume you mean for external representation purposes, in which case
> just use the %d format.  Otherwise, reading a hex number converts it
> automatically, so you don't need to bother about the internal
> representation.

What I want is a function like this:

(function "%1F)


and I do C-x C-e and it executes and calculates the decimal value and
returns or prints it.

>
> > 2) How do I convert ascii to the character that it represents, short
> > of a table ? Any function or simpler algorithm ?
>
> Use the %d format again.

what I want is a function like this:

(function "%3F")              and it converts it and returns or
prints ? either an existing facility or combination thereof.


> > 3) What are the variables
>
> Type "C-h v read-quoted-char-radix RET" etc. and you will be shown the
> documentation of the variable.

The documentation did not have an example of usage and contexts. I had
used describe-variable before.

> > and how to set their values ?
>
> "M-x set-variable RET read-quoted-char-radix RET <value> RET"

Can i use the following ?

(set "read-quoted-char-radix" 16)

or

(setq "read-quoted-char-radix" 16)


and which one and why ?

> > 4) How do i find the emacs lisp code for C-x = to see how it gives the
> > ascii of the char at the cursor and then use to find the reverse, ie
> > ascii to char ?
>
> "C-k C-x =".

Thanks.

> Sounds like you should read the basic parts of the Emacs manual and
> the Elisp manual, before you start coding in Lisp.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]