Author Topic: Function for test. Any help appreciated :)  (Read 1836 times)

0 Members and 1 Guest are viewing this topic.

kruuger

  • Swamp Rat
  • Posts: 637
Function for test. Any help appreciated :)
« on: October 04, 2012, 06:53:00 AM »
hi

i wrote small routine to display edit_box and ask user to enter specific data like: text, number, int or real.
for exmaple. code below required correct layer name, match pattern
Code: [Select]
(kr:DCL_StdEditBoxDialog
  (list 1
    (list
      (cons 1 "Need string")
      (cons 2 "Incorect layer")
      (cons 4 "Layer already exist")
      (cons 8 "Only spaces not allow")
      (cons 16 "Layer name do not match pattern")
    )
    "" "LAYER" "??-??"
  )
  "Layer" "New layer: (format ??-??)" 40 13 (list "&Ok" "&Cancel") T 5
)

another one ask for cabinet width (with range 0 < X < 30):
Code: [Select]
(kr:DCL_StdEditBoxDialog
  (list 3
    (list
      (cons 1 "Need string")
      (cons 2 "Number can't be a zero")
      (cons 8 "Only spaces not allow")
      (cons 16 "This is not a number")
      (cons 32 "Cabinet to small")
      (cons 64 "Cabinet to big")
    )
    "24" 0 30 4
  )
  "Cabinet" "Enter width:" 40 13 (list "&Ok" "&Cancel") T nil
)

could you guys make few test and see if all works fine? especially dialog with numbers. dialog should be LUNITS, LUPREC and DIMZIN independant if we specify additional info.
i think kr:DCL_StdEditBoxDialog argument should be clear. only more info about DATA.
DATA is a list of:
1. Code 0,1-string, 2-INT number, 3-REAL number
2. Bit - bit codes with errors what edit_box need to check
3. Val - default value displayed at dialog
4, 5, 6 - optional like table name, range for numbers, precision, output units. all should be discover in example at top of the code attached file.

any improvements also welcome.
thanks,
kruuger

kruuger

  • Swamp Rat
  • Posts: 637
Re: Function for test. Any help appreciated :)
« Reply #1 on: October 06, 2012, 06:06:48 PM »
could you guys make few test and see if all works fine?
:(