Author Topic: More subroutine functions  (Read 9753 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28708
Re: More subroutine functions
« Reply #30 on: March 24, 2009, 08:29:58 AM »
Not sure if I would consider myself even an 'average programmer' but a lot of what I see here would be 'obfuscated'. :)

Also, since we're talking about someone else reading the code, I didn't see anyone mention comments.

My simple approach might be something like this.
Code: [Select]
;;
;; setup default values
;;
(if (not (setq start (getint "\nEnter first plot to renumber<1>:")))
  ;; if user responds with <enter> set default
  (setq start 1)
  )

(if (not (setq stop (getint "\nEnter last plot to renumber<1000>:")))
  ;; if user responds with <enter> set default
  (setq stop 1000)
  )

(if (not (setq stepping (getint "\nEnter amount to increase each number by (negative values decrease)<1>:")))
  ;; if user responds with <enter> set default
  (setq stepping 1)
  )
TheSwamp.org  (serving the CAD community since 2003)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
Re: More subroutine functions
« Reply #31 on: March 24, 2009, 09:14:48 AM »
That method "Reads Well" even without the comments.  :-)
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: More subroutine functions
« Reply #32 on: March 24, 2009, 10:10:03 AM »
That method "Reads Well" even without the comments.  :-)

self documenting one might say :)
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9667
Re: More subroutine functions
« Reply #33 on: March 24, 2009, 10:21:49 AM »
I'm going to kick the back your chairs!
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: More subroutine functions
« Reply #34 on: March 24, 2009, 10:23:36 AM »
wut
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9667
Re: More subroutine functions
« Reply #35 on: March 24, 2009, 10:29:28 AM »
Post #15 i said to do just exactly that but all i got was Kerry ordering a t-shirt. Now that someone you guys actually like comes along...I'm gonna kick your chairs.
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

Mark

  • Custom Title
  • Seagull
  • Posts: 28708
Re: More subroutine functions
« Reply #36 on: March 24, 2009, 10:31:07 AM »
I'm going to kick the back your chairs!
:lol:
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28708
Re: More subroutine functions
« Reply #37 on: March 24, 2009, 10:33:37 AM »
Post #15 i said to do just exactly that but all i got was Kerry ordering a t-shirt. Now that someone you guys actually like comes along...I'm gonna kick your chairs.

Ah, so you did. Missed that one.

CAB, thats the obstacle im trying to overcome. [my] solution isnt creative, its simple logic. I would consider OR the creative use; in fact why not use IF (why use OR at all). (if (null (set var ... (set var)...?
TheSwamp.org  (serving the CAD community since 2003)

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9667
Re: More subroutine functions
« Reply #38 on: March 24, 2009, 10:35:09 AM »
I'm going to kick the back your chairs!
:lol:

Oh sure, keep playing with fire. ...I actually know what you look like!
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
Re: More subroutine functions
« Reply #39 on: March 24, 2009, 10:40:08 AM »
OK, we got John by the tail. Just gotta be quick or he'll bite ya. :lmao:
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: More subroutine functions
« Reply #40 on: March 24, 2009, 10:42:12 AM »
Just keep swinging him, you'll be fine.  :-D
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9667
Re: More subroutine functions
« Reply #41 on: March 24, 2009, 10:43:58 AM »
You guys are just lucky this computer is connected with only CAT 5 cable, cause if i had a wire for fists...
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: More subroutine functions
« Reply #42 on: March 24, 2009, 10:45:38 AM »
<Al Borland> I don't think so Tim. </Al Borland>
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9667
Re: More subroutine functions
« Reply #43 on: March 24, 2009, 10:52:30 AM »
*click* *snicker* Ive already started my virus. *sneer*
((0 1 1 1 0 1 0 0) (0 1 1 0 1 0 0 0) (0 1 1 0 0 1 0 1) (0 1 0 1 0 0 1 1) (0 1 1 1 0 1 1 1) (0 1 1 0 0 0 0 1) (0 1 1 0 1 1 0 1) (0 1 1 1 0 0 0 0) (0 0 1 0 1 1 1 0) (0 1 1 0 1 1 1 1) (0 1 1 1 0 0 1 0) (0 1 1 0 0 1 1 1) (0 0 1 0 0 0 0 0) (0 1 1 0 1 0 0 1) (0 1 1 1 0 0 1 1) (0 0 1 0 0 0 0 0) (0 1 1 1 0 1 0 0) (0 1 1 0 1 0 0 0) (0 1 1 0 0 1 0 1) (0 0 1 0 0 0 0 0) (0 1 1 1 0 0 0 0) (0 1 1 0 1 1 0 0) (0 1 1 0 0 0 0 1) (0 1 1 0 0 0 1 1) (0 1 1 0 0 1 0 1) (0 0 1 0 0 0 0 0) (0 1 1 1 0 1 0 0) (0 1 1 0 1 1 1 1) (0 0 1 0 0 0 0 0) (0 1 1 0 0 1 1 1) (0 1 1 0 0 1 0 1) (0 1 1 1 0 1 0 0) (0 0 1 0 0 0 0 0) (0 1 1 0 1 0 0 0) (0 1 1 0 0 1 0 1) (0 1 1 0 1 1 0 0) (0 1 1 1 0 0 0 0) (0 0 1 0 1 1 1 0))
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

Mark

  • Custom Title
  • Seagull
  • Posts: 28708
Re: More subroutine functions
« Reply #44 on: March 24, 2009, 10:56:15 AM »
You guys are just lucky this computer is connected with only CAT 5 cable, cause if i had a wire for fists...
TheSwamp.org  (serving the CAD community since 2003)