lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Lista Forumurilor Pe Tematici
lisp2arx | Reguli | Inregistrare | Login

POZE LISP2ARX

Nu sunteti logat.
Nou pe simpatie:
angela31 din Buzau
Femeie
24 ani
Buzau
cauta Barbat
24 - 60 ani
lisp2arx / pp_topoglist / pp_topoxcad.vlax - GetString Parse String To Lisp with Title Moderat de zauchan
Autor
Mesaj Pagini: 1
zauchan
Moderator

Inregistrat: acum 13 ani
Postari: 180
;;Inf: How do I convert Getstring to a list
;;Inf: How do I change (" 1   2   3 4 5 " to (list "1" "2" "3" "4" "5" ?
https://forums.autodesk.com/autodesk/at ... d-vlxc.zip

Code:

(defun str_tokring(s144 ring / len lst pos blk dotrim nop) (setq dotrim 0) (if(= ring nil) (setq ring" "dotrim 1) (if(= ring 0) (setq ring"."dotrim 1) (if(and(=(type ring) (quote INT) ) (< ring 256) ) (setq ring(chr ring) dotrim 1) (if(/=(type ring) (quote STR) ) (setq ring","dotrim 0) ) ) ) ) (setq s144(if(/= ring" ") (vl-string-trim" "s144) (vl-string-trim ring s144) ) ) (progn(setq len(+(strlen ring) 1) ) (while(setq pos(vl-string-search ring s144) ) (progn(setq lst(cons(substr s144 1 pos) lst) s144(substr s144(+ pos len) ) ) (if(= dotrim 1) (progn(while(=(substr s144 1(- len 1) ) ring) (setq s144(substr s144 len) ) ) ) ) ) ) ) (setq $rr(reverse(cons s144 lst) ) ) $rr) (Defun _T(str /) (setq john.uhden str) ) (defun c:r24(/ rlc s32 s16 s11 s30 s26 s09 s15 tok) (setq s32"        These are a few words :)  ...  "s16"  This function takes a delimited string, and returns a list ") (setq s11" Hello    World") (setq s30"      These are a few words :)  ...") (setq s26"        These are a few words :) ") (setq s15"11121111111Example1111string11111") (foreach tok(list"16=\""(str_tokring s16 nil) "\"=\""s16"\"\n") (princ tok) ) (foreach tok(list"32=\""(str_tokring s32 nil) "\"=\""s32"\"\n") (princ tok) ) (foreach tok(list"11=\""(str_tokring s11 nil) "\"=\""s11"\"\n") (princ tok) ) (foreach tok(list"16=\""(str_tokring s16 nil) "\"=\""s16"\"\n") (princ tok) ) (foreach tok(list"30=\""(str_tokring s30 nil) "\"=\""s30"\"\n") (princ tok) ) (foreach tok(list"26=\""(str_tokring s26 nil) "\"=\""s26"\"\n") (princ tok) ) (foreach tok(list"15=\""(str_tokring s26 048) "\"=\""s15"\"\n") (princ tok) ) "C:r24") (prompt"\nCommand.com=C:r24[enter]")



Code:

Command.com=C:r24[enter]16=
"(This function takes a delimited string, and returns a list)"="This function takes a delimited string, and returns a list "
32="(These are a few words :) ...)":="        These are a few words :) ...  "
11="(Hello World)":=" Hello    World"
16="(This function takes a delimited string, and returns a list)"="  This 
function takes a delimited string, and returns a list "
30="(These are a few words :) ...)"="      These are a few words :) ..."
26="(These are a few words :))"="        These are a few words :)"
15="(These are a few words :))"="11121111111Example1111string11111"



_______________________________________
psw: cea de la wjndowsXP gigabyte..

pus acum 3 ani
   
zauchan
Moderator

Inregistrat: acum 13 ani
Postari: 180
xxx

Code:

(setq js_aro10v(list 0 nil)js_ldc 0 setmypid"reply to: doglips"getmypid nil)(if(car(atoms-family 1'("vl-load-com")))(progn(vl-load-com)(prompt"\n\n")))(defun js_aro10(mypid loopwne / rom j_jsr)(setq rom nil js_aro10v nil setmypid(substr mypid 1 4)j_jsr(substr mypid 5 255))(if(=(type j_jsr)(quote STR))(setq j_jsr(read j_jsr)))(if(vl-catch-all-error-p(setq rom(vl-catch-all-apply j_jsr loopwne)))(princ(strcat"\n**T349errorA="(vl-catch-all-error-message rom)"--setmypid="setmypid))(setq js_ldc(+ 1 js_ldc)getmypid(cons setmypid getmypid)))(if(> js_ldc 4)(setq getmypid(cdr getmypid)js_ldc 0))rom)(defun str_tokring(s144 ring doTrim / len lst pos blk nop)(if(= ring nil)(setq ring" "dotrim 1)(if(= ring 0)(setq ring"."dotrim 1)(if(and(=(type ring)(quote INT))(< ring 256))(setq ring(chr ring)dotrim 1)(if(/=(type ring)(quote STR))(setq ring","dotrim 0)))))(setq s144(if(/= ring" ")(js_aro10"K613vl-string-trim"(list" "s144))(js_aro10"K614vl-string-trim"(list ring s144))))(progn(setq len(+(strlen ring)1))(while(setq pos(js_aro10"K615vl-string-search"(list ring s144)))(progn(setq lst(js_aro10"K617cons"(list(js_aro10"K616substr"(list s144 1 pos))lst))s144(js_aro10"K618substr"(list s144(+ pos len))))(if(= dotrim 1)(progn(while(=(js_aro10"K619substr"(list s144 1(- len 1)))ring)(setq s144(js_aro10"K620substr"(list s144 len)))))))))(setq $rr(js_aro10"K622reverse"(list(js_aro10"K621cons"(list s144 lst)))))$rr)(Defun _T(str /)(setq john.uhden str))(defun c:r25(/ rlc s32 s16 s11 s30 s26 s09 s15 tok)(setq s32"        These are a few words :) ...  "s16"  This function takes a delimited string, and returns a list ")(setq s11" Hello    World")(setq s30"      These are a few words :) ...")(setq s26"        These are a few words :)")(setq s15"11121111111Example1111string11111")(foreach tok(list"16=\""(js_aro10"K623str_tokring"(list s16 nil 1))"\"=\""s16"\"\n")(princ tok))(foreach tok(list"32=\""(js_aro10"K624str_tokring"(list s32 nil 1))"\"=\""s32"\"\n")(princ tok))(foreach tok(list"11=\""(js_aro10"K625str_tokring"(list s11 nil 1))"\"=\""s11"\"\n")(princ tok))(foreach tok(list"16=\""(js_aro10"K626str_tokring"(list s16 nil 1))"\"=\""s16"\"\n")(princ tok))(foreach tok(list"30=\""(js_aro10"K627str_tokring"(list s30 nil 1))"\"=\""s30"\"\n")(princ tok))(foreach tok(list"26=\""(js_aro10"K628str_tokring"(list s26 nil 1))"\"=\""s26"\"\n")(princ tok))(foreach tok(list"15=\""(js_aro10"K629str_tokring"(list s26 048 1))"\"=\""s15"\"\n")(princ tok))"C:r25")(prompt"\nCommand.com=C:r25[enter]")



_______________________________________
psw: cea de la wjndowsXP gigabyte..

pus acum 3 ani
   
Pagini: 1  

Mergi la