Author Topic: help with a lisp  (Read 10707 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: help with a lisp
« Reply #30 on: March 28, 2014, 06:07:37 AM »
Here is an observation; on options 1 & 2 you addresses the condition where the area was below a minimum value but in condition 3 you did not.
See my changes where option 3 has an error trap for values below 750.
Note also that condition statements will stop evaluating the conditions when one is true.
Therefore you do not need to bracket the value like
Code: [Select]
(and (> area 2000) (< area 4000))when you have already dealt with values below 2000 because the processing will never get this far for values <= 2000.
See my changes there too.
Lastly the last condition can simply be True and not
Code: [Select]
(> area 8000) as all other conditions have been addressed.

I also changed you user input for options 1 - 4 to use getKword instead of getinit.
This is a personal preference.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:test4 (/ _option1 _option2 _option3 _option4 area dxf ent sdarea skarea)
  2.   (defun _option1 ()
  3.     (cond ((<= area 200)
  4.            (setq sdarea area
  5.                  skarea (* area 0.7)
  6.            )
  7.           )
  8.           ((< area 700)
  9.            (setq sdarea 240
  10.                  skarea (* area 0.6)
  11.            )
  12.           )
  13.           (
  14.            (setq sdarea 400
  15.                  skarea (* area 0.6)
  16.            )
  17.           )
  18.     )
  19.   )
  20.   (defun _option2 ()
  21.     (cond ((<= area 2000)
  22.            (setq sdarea (* area 0.8)
  23.                  skarea (* area 0.6)
  24.            )
  25.           )
  26.           (t
  27.            (setq sdarea (+ 400 (* 0.05 (- area 2000)))
  28.                  skarea (* area 0.1)
  29.            )
  30.           )
  31.     )
  32.   )
  33.  
  34.   (defun _option3 ()
  35.     (cond ((< area 750)
  36.            (princ "\nERROR: Area is too small")
  37.           )
  38.           ((= area 750)
  39.            (setq sdarea 100
  40.                  skarea (* area 0.1)
  41.            )
  42.           )
  43.           ((<= area 1200)
  44.            (setq sdarea (+ 100 (/ (- area 750) 9))
  45.                  skarea (* area 0.1)
  46.            )
  47.           )
  48.           ((<= area 2000)
  49.            (setq sdarea (+ 150 (/ (- area 1200) 16))
  50.                  skarea (* area 0.1)
  51.            )
  52.           )
  53.           ((< area 4000)
  54.            (setq sdarea 0
  55.                  skarea 0
  56.            )
  57.           )
  58.           ((= area 4000)
  59.            (setq sdarea 200
  60.                  skarea (* area 0.1)
  61.            )
  62.           )
  63.           ((<= area 8000)
  64.            (setq sdarea (+ 200 (* 0.02 (- area 4000)))
  65.                  skarea (* area 0.1)
  66.            )
  67.           )
  68.           (t
  69.            (setq sdarea (+ 280 (* 0.01 (- area 8000)))
  70.                  skarea (* area 0.1)
  71.            )
  72.           )
  73.     )
  74.   )
  75.  
  76.   (defun _option4 ()
  77.     (initget 7)
  78.     (setq sdarea (* area (getreal "\n Give sd (example 1.2) : ")))
  79.     (initget 7)
  80.     (setq skarea (* area (getreal "\n Give sk in % (example 0.70) : ")))
  81.   )
  82.  
  83.  
  84.  
  85.   ;; Main -----
  86.   (if (and (setq ent (car (entsel "\n-> Select a closed polyline : ")))
  87.            (wcmatch (cdr (assoc 0 (setq dxf (entget ent)))) "*POLYLINE")
  88.            (member (cdr (assoc 70 dxf)) '(1 129))
  89.       )
  90.     (progn
  91.       (textpage)
  92.       (prompt
  93.         (strcat "\n choose option :" "\n " "\n  1. Choose 1 for this ..." "\n  2. Choose 2 for this ..."
  94.                 "\n  3. Choose 3 for this ..." "\n  4. Choose 4 for this ..." "\n"
  95.                )
  96.       )
  97.       (setq area (vlax-curve-getarea ent))
  98.       (initget 1 "1 2 3 4")
  99.       (setq option (getkword "Select Option 1 to 4 : ")
  100.       )
  101.       (cond ((= option "1") (_option1))
  102.             ((= option "2") (_option2))
  103.             ((= option "3") (_option3))
  104.             ((= option "4") (_option4))
  105.       )
  106.       (if area
  107.         (princ (strcat "\n Selected Area = "
  108.                        (rtos area 2 2)
  109.                        "\n D = "
  110.                        (rtos sdarea 2 2)
  111.                        " sq.m"
  112.                        "\n K = "
  113.                        (rtos skarea 2 2)
  114.                        " sq.m"
  115.                )
  116.         )
  117.       )
  118.     )
  119.     (princ "\n-> No valid polyline selected...")
  120.   )
  121.   (princ)
  122. )
  123.  
  124.  ;|«Visual LISP© Format Options»
  125. (120 2 2 2 nil "end of " 100 9 1 1 1 nil T nil T)
  126. ;*** DO NOT add text below the comment! ***|;
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.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #31 on: March 31, 2014, 03:34:22 AM »
Kerry i have another question

1) I change all the code with this ,but i have some erros
2) i want to add two different comments at the end

a) if   (oldare - anox) =< area <=(oldare + anox)  then print comment 1
b) if    area > (oldare + anox)  or   area < (oldare - anox)  then print comment 2

Code - Auto/Visual Lisp: [Select]
  1.    C:test(/ _OPTION1 _OPTION2 OLDARE AREA DXF ENT ANOX)
  2.   (DEFUN
  3.      _OPTION1 ()
  4.     (SETQ ANOX (* OLDARE 0.05))
  5.     DEFUN
  6.     _OPTION2
  7.     ()
  8.     (SETQ ANOX (* OLDARE 0.10))
  9.     ;; Main -----
  10.     (IF (AND
  11.           (SETQ ENT (CAR (ENTSEL "\nSelect a close polyline: ")))
  12.           (SETQ OLDARE (GETREAL "\ngive old area : "))
  13.           (WCMATCH
  14.             (CDR (ASSOC 0 (SETQ DXF (ENTGET ENT))))
  15.             "*POLYLINE"
  16.           )
  17.           (MEMBER (CDR (ASSOC 70 DXF)) '(1 129))
  18.         )
  19.       (PROGN
  20.         (INITGET 7)
  21.         (TEXTPAGE)
  22.         (PROMPT "\n text1  :
  23.  
  24.   1. option 1
  25.   2. option 2")
  26.         (SETQ
  27.           AREA   (VLAX-CURVE-GETAREA ENT)
  28.           OPTION (GETINT "choose 1 -->2: ")
  29.         )
  30.         (COND
  31.           ((= OPTION 1) (_OPTION1))
  32.           ((= OPTION 2) (_OPTION2))
  33.           (T (ALERT "Select > 2 --> Auto select 2. ") (_OPTION2))
  34.         )
  35.         (PRINC
  36.           (STRCAT
  37.             "\n Area = "
  38.             (RTOS AREA 2 2)
  39.             " sqm"
  40.             "\n Anotation Area = "
  41.             (RTOS ANOX 2 2)
  42.             " sqm"
  43.             "\n comments: "
  44.             "\n comment1....... "
  45.             "\n comment2....... "
  46.             "com "
  47.           )
  48.         )
  49.       )
  50.       (PRINC "\nError selection of polyline ...")
  51.     )
  52.     (PRINC)
  53.   )
  54.   (PRINC)
  55. )
  56.  

thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #32 on: March 31, 2014, 04:34:15 AM »

I'm certain if you apply yourself you can do this without too much trouble.

Regards,


kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #33 on: March 31, 2014, 06:47:47 AM »
Kerry i can't find the error   :embarrassed:

Code - Auto/Visual Lisp: [Select]
  1.    C:TEST (/ _OPTION1 _OPTION2 OLDARE AREA DXF ENT ANOX)
  2.   (DEFUN _OPTION1 () (SETQ ANOX (* OLDARE 0.05)))
  3.   (DEFUN _OPTION2 () (SETQ ANOX (* OLDARE 0.10)))
  4.   ;; Main -----
  5.   (IF (AND
  6.         (SETQ ENT (CAR (ENTSEL "\nSelect a close polyline: ")))
  7.         (SETQ OLDARE (GETREAL "\ngive old area : "))
  8.         (WCMATCH
  9.           (CDR (ASSOC 0 (SETQ DXF (ENTGET ENT))))
  10.           "*POLYLINE"
  11.         )
  12.         (MEMBER (CDR (ASSOC 70 DXF)) '(1 129))
  13.       )
  14.     (PROGN
  15.       (INITGET 7)
  16.       (TEXTPAGE)
  17.       (PROMPT
  18.         "\n text1  :
  19.  
  20.   1. option 1
  21.   2. option 2
  22.        "
  23.       )
  24.       (SETQ
  25.         AREA   (VLAX-CURVE-GETAREA ENT)
  26.         OPTION (GETINT "choose 1 -->2: ")
  27.       )
  28.       (COND
  29.         ((= OPTION 1) (_OPTION1))
  30.         ((= OPTION 2) (_OPTION2))
  31.         (T (ALERT "Select > 2 --> Auto select 2. ") (_OPTION2))
  32.       )
  33.       (PRINC
  34.         (STRCAT
  35.           "\n Area = "
  36.           (RTOS AREA 2 2)
  37.           " sqm"
  38.           "\n Anotation Area = "
  39.           (RTOS ANOX 2 2)
  40.           " sqm"
  41.           "\n comments: "
  42.           "\n "
  43.           (COND
  44.             ((AND
  45.                (>= AREA (- OLDARE ANOX))
  46.                (<= AREA (+ OLDARE ANOX))
  47.                (PRINC "\n comment1")
  48.                ((AND
  49.                   (> AREA (+ OLDARE ANOX))
  50.                   (< AREA (- OLDARE ANOX))
  51.                   (PRINC "\n comment2")
  52.                 )
  53.                )
  54.              )
  55.              (PRINC "\nError selection of polyline ...")
  56.             )
  57.             (PRINC)
  58.           )
  59.           (PRINC)
  60.         )
  61.       )
  62.     )
  63.   )
  64. )
  65.  ;|«Visual LISP© Format Options»
  66. (72 2 40 2 nil "end of " 60 2 2 2 1 nil nil nil T)
  67. ;*** DO NOT add text below the comment! ***|;
  68.  
  69.  

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: help with a lisp
« Reply #34 on: March 31, 2014, 06:59:39 AM »
Take a look at you parenthesis around the "and" functions, and it appears you have variables (ie; comment1 & comment2) being used as text in the princ line.  Look at using the strcat function

example;
Code: [Select]
(and
    (foo1)
    (foo2)
)

You've seen enough examples here from others that you can figure this out.  (time to cowboy up)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #35 on: March 31, 2014, 07:19:34 AM »
Additionally ;

Your conditional statement is unbalanced.

Study this
Each branch consists of a self contained Test and a statement set  to execute if the test is true.

Code - Auto/Visual Lisp: [Select]
  1. (cond ((and (true-or-false-test-01)
  2.             (true-or-false-test-02)
  3.        )
  4.        (setq xxx 0102)
  5.       )
  6.       ((and (true-or-false-test-03)
  7.             (true-or-false-test-04)
  8.        )
  9.        (setq xxx 0304)
  10.       )
  11.       ((and (true-or-false-test-01)
  12.             (true-or-false-test-03)
  13.        )
  14.        (setq xxx 0103)
  15.       )
  16.       ((and (true-or-false-test-02)
  17.             (true-or-false-test-03)
  18.        )
  19.        (setq xxx 0203)
  20.       )
  21. )
  22.  
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #36 on: April 01, 2014, 10:25:53 AM »
Kerry i can not understand it. Can you help me.

Thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #37 on: April 01, 2014, 10:48:23 AM »
Untested

Code - Auto/Visual Lisp: [Select]
  1.  
  2.    C:TEST (/ _OPTION1 _OPTION2 OLDARE AREA DXF ENT ANOX)
  3.   (defun _OPTION1 () (setq ANOX (* OLDARE 0.05)))
  4.   (defun _OPTION2 () (setq ANOX (* OLDARE 0.10)))
  5.   ;; Main -----
  6.   (if (and
  7.         (setq
  8.           ENT
  9.            (car (entsel "\nSelect a close polyline: "))
  10.         )
  11.         (setq OLDARE (getreal "\ngive old area : "))
  12.         (wcmatch
  13.           (cdr (assoc 0 (setq DXF (entget ENT))))
  14.           "*POLYLINE"
  15.         )
  16.         (member (cdr (assoc 70 DXF)) '(1 129))
  17.       )
  18.     (progn
  19.       (initget 7)
  20.       (textpage)
  21.       (prompt
  22.         "\n text1  :
  23.  
  24.   1. option 1
  25.   2. option 2
  26.        "
  27.       )
  28.       (setq
  29.         AREA   (vlax-curve-getarea ENT)
  30.         OPTION (getint "choose 1 -->2: ")
  31.       )
  32.       (cond
  33.         ((= OPTION 1) (_OPTION1))
  34.         ((= OPTION 2) (_OPTION2))
  35.         (t
  36.          (alert "Select > 2 --> Auto select 2. ")
  37.          (_OPTION2)
  38.         )
  39.       )
  40.       (princ
  41.         (strcat
  42.           "\n Area = "
  43.           (rtos AREA 2 2)
  44.           " sqm"
  45.           "\n Anotation Area = "
  46.           (rtos ANOX 2 2)
  47.           " sqm"
  48.           "\n comments: "
  49.           "\n "
  50.           (cond
  51.             ((and
  52.                (>= AREA (- OLDARE ANOX))
  53.                (<= AREA (+ OLDARE ANOX))
  54.              )
  55.              (princ "\n comment1")
  56.             )
  57.             ((and
  58.                (> AREA (+ OLDARE ANOX))
  59.                (< AREA (- OLDARE ANOX))
  60.              )
  61.              (princ "\n comment2")
  62.             )
  63.           )
  64.         )
  65.       )
  66.     )
  67.     (princ "\nError selection of polyline ...")
  68.   )
  69.   (princ)
  70. )
  71.  
  72.  
  73.  
  74.  
  75.  
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #38 on: April 01, 2014, 10:54:15 AM »
Thank you Kerry

pedroantonio

  • Guest
Re: help with a lisp
« Reply #39 on: April 01, 2014, 11:38:16 AM »
Kerry I have problem with print comment 2
I change litle bit the code . But i still have print problem .Can you check it.

Code - Auto/Visual Lisp: [Select]
  1.    C:TEST (/ _OPTION1 _OPTION2 OLDARE AREA DXF ENT ANOX T1 T2)
  2.   (DEFUN _OPTION1 () (SETQ ANOX (* OLDARE 0.05)))
  3.   (DEFUN _OPTION2 () (SETQ ANOX (* OLDARE 0.10)))
  4.   ;; Main -----
  5.   (IF (AND
  6.         (SETQ ENT (CAR (ENTSEL "\nSelect a close polyline: ")))
  7.         (SETQ OLDARE (GETREAL "\ngive old area : "))
  8.         (WCMATCH
  9.           (CDR (ASSOC 0 (SETQ DXF (ENTGET ENT))))
  10.           "*POLYLINE"
  11.         )
  12.         (MEMBER (CDR (ASSOC 70 DXF)) '(1 129))
  13.       )
  14.     (PROGN
  15.       (INITGET 7)
  16.       (TEXTPAGE)
  17.       (PROMPT
  18.         "\n text1  :
  19.  
  20.   1. option 1
  21.   2. option 2
  22.        "
  23.       )
  24.       (SETQ
  25.         AREA   (VLAX-CURVE-GETAREA ENT)
  26.         OPTION (GETINT "choose 1 -->2: ")
  27.       )
  28.       (COND
  29.         ((= OPTION 1) (_OPTION1))
  30.         ((= OPTION 2) (_OPTION2))
  31.         (T (ALERT "Select > 2 --> Auto select 2. ") (_OPTION2))
  32.       )
  33.       (SETQ T1 (- OLDARE ANOX))
  34.       (SETQ T2 (+ OLDARE ANOX))
  35.       (PRINC
  36.         (STRCAT
  37.           "\n Area = "
  38.           (RTOS AREA 2 2)
  39.           " sqm"
  40.           "\n Anotation Area = ± "
  41.           (RTOS ANOX 2 2)
  42.           " sqm"
  43.           "\n "
  44.           "\n comments: "
  45.           "\n "
  46.           (COND
  47.             ((AND (>= AREA T1) (<= AREA T2))
  48.              (PRINC
  49.                "\n "
  50.                (RTOS T1 2 2)
  51.                " sqm <="
  52.                (RTOS AREA 2 2)
  53.                " <= "
  54.                (RTOS T2 2 2)
  55.                " sqm"
  56.                "\n comment1"
  57.              )
  58.             )
  59.             ((AND (> AREA T2) (< AREA T1))
  60.              (PRINC
  61.                (PRINC
  62.                  "\n "
  63.                  (RTOS T1 2 2)
  64.                  " sqm > "
  65.                  (RTOS AREA 2 2)
  66.                  " > "
  67.                  (RTOS T2 2 2)
  68.                  "sqm"
  69.                  "\n comment2"
  70.                )
  71.              )
  72.             )
  73.           )
  74.         )
  75.       )
  76.       (PRINC "\nError selection of polyline ...")
  77.     )
  78.     (PRINC)
  79.   )
  80.   ;|«Visual LISP© Format Options»
  81. (72 2 40 2 nil "end of " 60 2 2 2 1 nil nil nil T)
  82. ;*** DO NOT add text below the comment! ***|;
  83. )
  84.  

Thank you

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #40 on: April 01, 2014, 11:45:53 AM »
Explain EXACTLY what is wrong.
What are your pre-condition values ?
What do you expect What ?
and what you get what ?

For the cause of the problem, look first at the things you changed.

Added:
Looking at your code, you need to fix the last several lines of code.
Compare my post with yours.
I'll look at your comment code when you respond satisfactorily to my information request.
« Last Edit: April 01, 2014, 11:57:32 AM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #41 on: April 01, 2014, 12:58:39 PM »
Sorry Kerry.I will explain you now..

I want
a) when  T1< = Area <= T2 to print T1< = Area <= T2 and comment 1
b) when  T1>Area >T2 to print T1> Area > T2 and comment 2

Your code works only for comment 1 , for comment 2 gives error. I add in the code ths lines

Code - Auto/Visual Lisp: [Select]
  1.  
  2.  
  3. (SETQ T1 (- OLDARE ANOX))
  4. (SETQ T2 (+ OLDARE ANOX))
  5. --------------------
  6. -----------------
  7.  
  8.             ((AND (>= AREA T1) (<= AREA T2))
  9.              (PRINC
  10.                "\n "
  11.                (RTOS T1 2 2)
  12.                " sqm <="
  13.                (RTOS AREA 2 2)
  14.                " <= "
  15.                (RTOS T2 2 2)
  16.                " sqm"
  17.                "\n comment1"
  18.              )
  19.             )
  20.             ((AND (> AREA T2) (< AREA T1))
  21.              (PRINC
  22.                (PRINC
  23.                  "\n "
  24.                  (RTOS T1 2 2)
  25.                  " sqm > "
  26.                  (RTOS AREA 2 2)
  27.                  " > "
  28.                  (RTOS T2 2 2)
  29.                  "sqm"
  30.                  "\n comment2"
  31.                )
  32.  

but i still have problem with the results . I test the code in autocad vlisp editor  but i can not find were the problem is. if you can help.

Thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #42 on: April 01, 2014, 01:05:11 PM »
You're going to have to learn to listen bud !
I didn't ask for freaking code, I asked for data.

Give me values for comment 1
Area :
OLDARE :
ANOX :

Give me values for comment 2
Area :
OLDARE :
ANOX :

... as many combinations as you like.

Without knowing the data and the expected results I may as well just walk away.


added:
and please confirm the rules because this isn't what you've coded.
Quote
I want
a) when  T1<= Area <= T2     to print T1<= Area <= T2 and comment 1
b) when  T1 >  Area     >T2    to print    T1> Area >T2 and comment 2
« Last Edit: April 01, 2014, 01:15:15 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #43 on: April 01, 2014, 01:28:52 PM »
Karry here is the example


for option 1 (comment 1)
OLD AREA 8000sqm
Area 8062sqm
Anox 8000 * 0.05 = 400 sqm
T1 =  8000 - 400 = 7600 sqm
T2 =  8000 + 400 = 8400 sqm

7600< 8062 <8400  so
comment 1

for option 1 (comment 2)

OLD AREA 8000sqm
Area 9500sqm
Anox 8000 * 0.05 = 400 sqm
T1 =  8000 - 400 = 7600 sqm
T2 =  8000 + 400 = 8400 sqm

7600>9500 >8400  so
comment 2
 -----------------------------------------------

for option 2 (comment 1)
OLD AREA 8000sqm
Area 7500sqm
Anox 8000 * 0.10 = 800 sqm
T1 =  8000 - 800 = 7200 sqm
T2 =  8000 + 800 = 8800 sqm

7200< 7500 <8800  so
comment 1

for option 2 (comment 2)

OLD AREA 8000sqm
Area 7100sqm
Anox 8000 * 0.10 = 800 sqm
T1 =  8000 - 800 = 7200 sqm
T2 =  8000 + 800 = 8800 sqm 

Here we have a change in the code

7200>7100  so
comment 2

if we have

for option 2 (comment 2)

OLD AREA 8000sqm
Area 8950sqm
Anox 8000 * 0.10 = 800 sqm
T1 =  8000 - 800 = 7200 sqm
T2 =  8000 + 800 = 8800 sqm 

Here we have a change in the code

8950 > 8800  so
comment 2

The comment 2 i thing need 3 options
T1>Area>T2
T1>Area
T2< Area


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #44 on: April 01, 2014, 02:02:35 PM »
for option 1 (comment 2)

OLD AREA 8000sqm
Area 9500sqm
Anox 8000 * 0.05 = 400 sqm
T1 =  8000 - 400 = 7600 sqm
T2 =  8000 + 400 = 8400 sqm

7600>9500 >8400  so
comment 2
 -----------------------------------------------

7600>9500 >8400 This is crap.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.