<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Basic String-Number Conversion in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404007#M59134</link>
    <description>&lt;P&gt;Here's the first one... I guess the second is up to you!?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:input (/ n1 n2)
  (setq n1 '(("a" 1)("b" 2)("c" 3)))
  (setq n2 (getstring "Enter Letters: "))
  (setq n3 (cadr (assoc (strcase n2 t) n1)))
  (princ n3)
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some hints for the second.&lt;/P&gt;
&lt;P&gt;(initget 7) stands alone prior to (get*) functions.&lt;/P&gt;
&lt;P&gt;(getstring) returns string as "a" or "1"&lt;/P&gt;
&lt;P&gt;(getint) returns an integer as 1. Text is not allowed.&lt;/P&gt;
&lt;P&gt;(itoa) converts an integer into string: (itoa 1) returs "1".&lt;/P&gt;</description>
    <pubDate>Sat, 19 Jun 2021 17:20:47 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2021-06-19T17:20:47Z</dc:date>
    <item>
      <title>Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10403955#M59133</link>
      <description>&lt;P&gt;Looking to further understand how letters and numbers can converge based on variables. I have (2) codes. One simply I want to type "ABC" and then get the real numbers to print "123" hence A=1 B=2 C=3. For now it only prints "abc" as typed and not the desired 123. I know that it's basically printing my variable I already typed but I though overriding this variable with the initial setq would fix this?On the contrary I want a second version that reverses this so as to type "123" and get it to print "ABC". I cannot seem to get them to work I think I am misunderstanding something.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:input (/ n1 n2)
(setq n1 '((a 1)(b 2)(c 3)))
(setq n2 (getstring "Enter Letters: "))
(setq n3 (atoi n2 n1))
(princ n3)
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;(defun c:output (/ n1 n2)
(setq n1 '((1 a)(2 b)(3 c)))
(setq n2 (initget 7 "Enter Numbers: "))
(setq n3 (itoa n2 n1))
(princ n3)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 19 Jun 2021 16:49:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10403955#M59133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-19T16:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404007#M59134</link>
      <description>&lt;P&gt;Here's the first one... I guess the second is up to you!?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:input (/ n1 n2)
  (setq n1 '(("a" 1)("b" 2)("c" 3)))
  (setq n2 (getstring "Enter Letters: "))
  (setq n3 (cadr (assoc (strcase n2 t) n1)))
  (princ n3)
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some hints for the second.&lt;/P&gt;
&lt;P&gt;(initget 7) stands alone prior to (get*) functions.&lt;/P&gt;
&lt;P&gt;(getstring) returns string as "a" or "1"&lt;/P&gt;
&lt;P&gt;(getint) returns an integer as 1. Text is not allowed.&lt;/P&gt;
&lt;P&gt;(itoa) converts an integer into string: (itoa 1) returs "1".&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 17:20:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404007#M59134</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-06-19T17:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404072#M59135</link>
      <description>&lt;P&gt;Did you mean "a", "b" or "c" ? To get 1, 2 or 3?&lt;/P&gt;
&lt;P&gt;Or you really want to type "abc" to get "123" or say "ac" gets you "13" ?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 17:59:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404072#M59135</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-06-19T17:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404165#M59136</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;'s questions, and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;'s pointers, if not with the code in Message 2, which would appear to work only for &lt;EM&gt;single&lt;/EM&gt;-letter input.&amp;nbsp; Multi-letter input could certainly be done, but it would require stepping through the input string one character at a time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, would this concept extend beyond just a few letters at the beginning of the alphabet?&amp;nbsp; To get "KLM" as an output, you would need to type 11 &amp;amp; 12 &amp;amp; 13, presumably in the format "111213", but in that case how is it to know that you don't want the result to be "AAABAC"?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 18:54:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404165#M59136</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-06-19T18:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404186#M59137</link>
      <description>&lt;P&gt;Yes I need the numbers/letters to be arbitrary in sequence. If CAB was typed the display would be 312. Sorry for not making this clearer.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 19:03:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404186#M59137</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-19T19:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404195#M59138</link>
      <description>&lt;P&gt;Essentially for the start of this imagine the alphabet is numerically represented. Numbers 1-27 would be A-Z. So in this case I want to type "85-12-12-15" to get "hello" and vice versa. For whatever reason I wasn't thinking passed single digit numbers (was just starting basic) and it didn't occur to me that something like "26" could be read as "bf" or just "y". So I guess I'm also looking for a way to insert the hyphens or some other separator. Maybe some condition that if the number is 9 or below read the numbers separate but above that use as a single number what's between hyphens?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 19:10:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404195#M59138</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-19T19:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404214#M59139</link>
      <description>&lt;P&gt;Wow this got complicated fast. Right after asking I realized how annoying the hyphen solution would be. This is way above what I can think of how to code this. Essentially I would just want to type "85121215" and get "hello". I'm thinking that somehow the lisp will have to read the first 2 digits for start. It will read "8" and "5". It will take these two numbers, combine them on the surface (to get "85" rather than 13), if the number is greater than 27 then read as individual numbers only. So "8" and "5" would be stored and then the next two would be evaluated. "12" would be read as "L" since the two numbers are less than 27 when combined on the "surface". Same for the others. I don't know if this can be done.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 19:22:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404214#M59139</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-19T19:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404222#M59140</link>
      <description>&lt;P&gt;You might use + as a delimiter. You need to have SOME delimiter. If you use a numpad, it's quite natural...&lt;/P&gt;
&lt;P&gt;85+12+12+15&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 19:26:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404222#M59140</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-06-19T19:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404313#M59141</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... I would just want to type "85121215" and get "hello". ... somehow the lisp will have to read the first 2 digits for start. It will read "8" and "5". It will take these two numbers ... if the number is greater than 27 then read as individual numbers only. So "8" and "5" would be stored and then the next two would be evaluated. "12" would be read as "L" ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's not going to be unambiguous.&amp;nbsp; "85121215" could be "heababae".&amp;nbsp; What if you want [whether at the start or elsewhere] "ab", not "l"?&amp;nbsp; Either would be "12".&amp;nbsp; For another example, "head" and "hen" would both be "8514" -- how could it know which you intended?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest you consider using &lt;EM&gt;two digits for each, with preceding zeros for the one-digit numbers:&lt;/EM&gt;&amp;nbsp; 01 for "a", 02 for "b", etc.&amp;nbsp; Then you wouldn't need to have separators/delimiters, and there would never be ambiguity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then there's the question of upper-case vs. lower-case letters....&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 20:26:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404313#M59141</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-06-19T20:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404469#M59142</link>
      <description>&lt;P&gt;That works great for me! No need to clarify upper and lower case they can all just be upper!&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 22:39:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404469#M59142</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-19T22:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404478#M59143</link>
      <description>&lt;P&gt;I suppose there are no numbers or symbols as well? " 2 EGGS AT 5$?"&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 22:48:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404478#M59143</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-06-19T22:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404547#M59144</link>
      <description>&lt;P&gt;I dont understand so many posts and nobody looked at just use the ascii code returned for the letters A=65 a=97 as mentioned need to walk trough the string 1 character at a time so ABC-def is valid also just strcase 1st so no lowercase.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun c:numstr ( / str x num)			 
(setq str (strcase (getstring "\nType in string")))
(setq x 1 newstr "")
(repeat (strlen str)
    (setq num  (- (ascii (substr str x 1)) 64))
    (if (and (&amp;gt;  num 0) (&amp;lt;  num 27))
      (progn
        (setq   newstr (strcat newstr (rtos num 2 0)))
        (setq x (+ x 1))
      )
    )
)
(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need some real strings to look at combos as result ABcde-FG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 23:56:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404547#M59144</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-06-19T23:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404854#M59145</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;..Essentially I would just want to type "85121215" and get "hello". .&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;Is this some sort of encrypting/decypting code? Did anyone approach you to crack the enigma machine ?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;If that's the case,&amp;nbsp; you may also need a key to go with the message. Please tell us more.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Just so you know,&amp;nbsp; I went through the same phase when i was starting to learn how to code&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 05:24:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10404854#M59145</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-06-20T05:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10405327#M59146</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... just use the ascii code returned for the letters A=65 a=97 ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's valid when going from letters to numbers, since letters are only one character each.&amp;nbsp; But going from numbers to letters still has the problem that not all have the same number of digits.&amp;nbsp; It could work if limited to capital letters &lt;EM&gt;and&lt;/EM&gt; if Users know the appropriate numbers from 65 up and can enter them that way, so that all can be 2-digit numbers.&amp;nbsp; But if you want 1 to represent A, etc., the same issues arise.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 11:34:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10405327#M59146</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-06-20T11:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10405672#M59147</link>
      <description>&lt;P&gt;The switch from ASCII to base-1 would just mean having the code add 64 or 96 to user input or subtract it from ASCII before making the number string. &amp;nbsp;Agree that padding numbers to 2 digits is necessary. Whether 2-digit numbers are required at entry depends on whether code takes a string of numbers (padding reqd) or whether the user is typing them one at a time with a delimiter like SPACE or ENTER between them (no padding reqd). &amp;nbsp;Also, the offset from ASCII to 1 would break if the code is supposed to handle digits because they’d be negative after subtracting 64 or 96, so you’d need to screen for valid inputs in any case. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 15:45:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10405672#M59147</guid>
      <dc:creator>jlbelshan</dc:creator>
      <dc:date>2021-06-20T15:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10406203#M59148</link>
      <description>&lt;P&gt;Haha I see where you are coming from. Yes I am trying to make a very basic algorithm lisp. I've got people that work with me that understand CAD and lisps and don't get algorithms. So I was trying to make a simple one to show how it all works and I couldn't figure it out so here I am. I know it's possible. Read some guy made an insanely tough algorithm all in lisp. It's a language called "Malboge". Just saying "hello world" is like two paragraphs long in that. I just want my simple letter to number algorithm example lol.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 21:46:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10406203#M59148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-20T21:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10406366#M59149</link>
      <description>&lt;P&gt;Kent yes your right I did some code at some point in time and you reminded me needed to be 2 digit answer so A=01. The lower case can be incorporated then also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HELLO = 0804111114&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 00:11:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10406366#M59149</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-06-21T00:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10406843#M59150</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;I just want my simple letter to number algorithm example lol.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Okay then, now lets play with a simple &lt;STRIKE&gt;algorhythm&lt;/STRIKE&gt; &lt;STRIKE&gt;allgorithem&amp;nbsp;&lt;/STRIKE&gt;&amp;nbsp;algorithm.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;You can start by creating a list using direct substitution.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:input (/ n1 n2 n2l)
(setq n1 '((69 . "05") (72 . "08")(76 . "12")(79 . "15")) )
(if
  (and
     (setq n2 (strcase (getstring  "\nEnter Letters: ")))
     (vl-every '(lambda (l)
		     (assoc l n1))
		     (setq n2l (vl-string-&amp;gt;list n2))
		  )
     )
  (print (apply 'strcat
	       (mapcar '(lambda	(c)
			  (cdr (assoc c n1))
			)
			n2l
		       )
	       )
	)
  (princ "\nInvalid character input")
  )(princ)
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Command: &lt;STRONG&gt;Input&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Enter Letters: &lt;STRONG&gt;Hello&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;"0805121215"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Or you can use any single character and not necessarily a number&amp;nbsp;to make it easier to decrpyt by replacing n1 list with this&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(setq n1 '((69 . "^")(72 . "Z")(76 . "3")(79 . "$")))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Command: &lt;STRONG&gt;Input&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Enter Letters: &lt;STRONG&gt;Hello&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Z^33$&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Which in turn returning it back to "HELLO" is easy using the same code and replacing these two lines&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(defun c:output (/ n1 n2 n2l)
(setq n1 '(( 94 . "E")(90 . "H")(51 . "L")(36 . "O")))
...	
(setq n2 (strcase (getstring "\nEnter string to decrypt: ")))
...
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Command: &lt;STRONG&gt;output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Enter string to decrypt:&amp;nbsp; &lt;STRONG&gt;Z^33$&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;"HELLO"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;You can build the entire substition list to include just about everything.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;HTH&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 06:39:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10406843#M59150</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-06-21T06:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10407927#M59151</link>
      <description>&lt;P&gt;That is awesome man thank you so much! I will definitely be messing with this a lot and sharing it. Much appreciated, seriously. Everyone will love this.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 13:46:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10407927#M59151</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-21T13:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Basic String-Number Conversion</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10408666#M59152</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That is awesome man thank you so much! I will definitely be messing with this a lot and sharing it. Much appreciated, seriously. Everyone will love this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Anytime LispHunt42, let us know if you need more help with coding a more complex algorithm.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Cheers&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 17:31:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/basic-string-number-conversion/m-p/10408666#M59152</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-06-21T17:31:28Z</dc:date>
    </item>
  </channel>
</rss>

