Author Topic: what does "lock" mean?  (Read 1997 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Guest
what does "lock" mean?
« on: September 18, 2014, 12:28:01 PM »
in some old code i was looking at i noticed this

(setq lock3 1)

and further down the code it has
(if (= lock3 1)
  (setq ptby (- ptay (* sclf 1.01971)))
  (setq ptby (- ptay (* SCLF 0.375)))
  )

but no where is lock3 set to anything other than 1 in the beginning of the code.

i tried to look thru the documentation to see if it has anything but there is nothing there.
is this a hidden variable?
can anyone shed some light on what "lock3" is supposed to mean?

kpblc

  • Bull Frog
  • Posts: 396
Re: what does "lock" mean?
« Reply #1 on: September 18, 2014, 01:06:00 PM »
Perhaps somewhere (i mean any function you calls) variable 'lock3' is not localized.
Sorry for my English.

tedg

  • Swamp Rat
  • Posts: 811
Re: what does "lock" mean?
« Reply #2 on: September 18, 2014, 01:13:42 PM »
Being a "setq", isn't it simply a variable made up within the routine that is tied to something else referred to later?
You would also need to know what ptby, ptay and sclf mean too right?


Appears to be a math equation after an if statement.
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

ChrisCarlson

  • Guest
Re: what does "lock" mean?
« Reply #3 on: September 18, 2014, 01:27:01 PM »
Perhaps somewhere (i mean any function you calls) variable 'lock3' is not localized.

I'd have to agree but even if it was localized lock3 would need to be set to 1, without being set lock3 will have a value of nil.

BUT if this is the only mention of lock3 it doesn't quite make sense without the full script we will never know.

kpblc

  • Bull Frog
  • Posts: 396
Re: what does "lock" mean?
« Reply #4 on: September 18, 2014, 01:30:27 PM »
That's right. The only way i know is to check every function you wrote by pressing Ctrl+Shift+C within VLIDE: IDE can show you many 'errors' ;)
Sorry for my English.

andrew_nao

  • Guest
Re: what does "lock" mean?
« Reply #5 on: September 18, 2014, 02:29:49 PM »
i did a search within the file and found 2 instances of it, both gave it a value of 1... the program didnt work regardless i was just curious what that lock3 meant, thought it might have been a function in acad.
it seems to be a made up variable within the program. apparently whoever started on the file before me just never finished it
the ptby and ptay are just coordinates within the dwg file.

thanks for everyones replies

kpblc

  • Bull Frog
  • Posts: 396
Re: what does "lock" mean?
« Reply #6 on: September 18, 2014, 03:01:59 PM »
Could you show full code?
Sorry for my English.

RC

  • Guest
Re: what does "lock" mean?
« Reply #7 on: September 18, 2014, 03:04:03 PM »
(setq merely defines a variable and sets it equal to 'something'.

In the case (setq lock3 1)
creates the variable 'lock3' and assigns the value 1 to that variable.


Jeff H

  • Needs a day job
  • Posts: 6142
Re: what does "lock" mean?
« Reply #8 on: September 18, 2014, 06:05:50 PM »
Lock could mean one of following
  • a mechanism for keeping a door, lid, etc., fastened, typically operated only by a key of a particular form.
  • a short confined section of a canal or other waterway in which the water level can be changed by the use of gates and sluices, used for raising and lowering vessels between two gates.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: what does "lock" mean?
« Reply #9 on: September 18, 2014, 06:23:12 PM »
Or maybe it was some sort of licensing scheme the original author had, since it is apparent it is only part of a larger set of code, it is impossible to determine.