The Buzzard Posted June 24, 2009 Posted June 24, 2009 Here's another calculator, But this one does unit converions from Imperial to Metric or Metric to Imperial. The calculator has 42 conversions total or 21 & 21. You may add more if you wish. Please take it for a test spin and let me know about the quirks. Thanks, The Buzzard REVISION NOTICE VERSION 2 NOW ADDED ADDED GET VARIABLE AND ERROR FUNCTIONS *Revisions* Date Change Program By 06/25/09 Add UCC_T2N, UCC_GLV, UCC_GCV functions. UCCv2.lsp AMB UCCv2.zip Quote
Lee Mac Posted June 24, 2009 Posted June 24, 2009 Buzzard, My comments from the other thread still apply, you have functions that are being called with arguments, but then the arguments are immediately changed to unrelated variables. Quote
The Buzzard Posted June 24, 2009 Author Posted June 24, 2009 Buzzard, My comments from the other thread still apply, you have functions that are being called with arguments, but then the arguments are immediately changed to unrelated variables. That might be why I get bad argument and nil calls when I remove them. I will look further into that. Also I have shortened it up a bit. Thanks Lee Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 That might be why I get bad argument and nil calls when I remove them. I will look further into that. Also I have shortened it up a bit. Thanks Lee Lee, I was able to remove the argument from one function, But not the other. I am not sure what to do about it at this point. The program will not run without it. Quote
Lee Mac Posted June 25, 2009 Posted June 25, 2009 Lee, I was able to remove the argument from one function, But not the other. I am not sure what to do about it at this point. The program will not run without it. Its because you are passing arguments to these functions incorrectly - you will need to approach this differently. Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 Its because you are passing arguments to these functions incorrectly - you will need to approach this differently. Is this a program re-write? Or is not that bad? Quote
Lee Mac Posted June 25, 2009 Posted June 25, 2009 Is this a program re-write? Or is not that bad? A part re-write I think. There are quite a few ways you could improve this program, but I haven't got the time right now to be writing it Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 I am not looking for you to re-write it. If you can give me an idea where to look, It would be appreciated and maybe I would not be changing things all over the program. I have some suspicions, But I am unsure of myself. Quote
Lee Mac Posted June 25, 2009 Posted June 25, 2009 Well, the way I see it, you have two options regarding the way you transfer data between the functions. (CAB's example on the Ohm Calculator was a good one to follow). You could either: Use variables that remain global through all the sub-functions, and reference each other in every function. (not my preferred method - gets quite messy). Use sub-functions with arguments, and construct the sub-functions so that the return of each is known and useable (if you know what I mean). An example of this method is shown in my line-length calculator. At the moment, you have sub-functions requiring arguments, and are supplying the sub-functions with arguments that contain unrelated data, which, at the same time you are setting to variables that you also pass between the functions... a messy amalgam of the two methods shown above. Hope this helps, Lee Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 Well, the way I see it, you have two options regarding the way you transfer data between the functions. (CAB's example on the Ohm Calculator was a good one to follow). You could either: Use variables that remain global through all the sub-functions, and reference each other in every function. (not my preferred method - gets quite messy). Use sub-functions with arguments, and construct the sub-functions so that the return of each is known and useable (if you know what I mean). An example of this method is shown in my line-length calculator. At the moment, you have sub-functions requiring arguments, and are supplying the sub-functions with arguments that contain unrelated data, which, at the same time you are setting to variables that you also pass between the functions... a messy amalgam of the two methods shown above. Hope this helps, Lee I see that this is going to get deep, But I will make an All-Out attempt on this. I shall take a closer look and implement the fixes. Thanks Lee Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 I see that this is going to get deep, But I will make an All-Out attempt on this. I shall take a closer look and implement the fixes. Thanks Lee Ok, UCCv1.lsp has been revised to UCCv2.lsp. Revision 2 is now on the first post. Thank You, The Buzzard Quote
David Bethel Posted June 25, 2009 Posted June 25, 2009 The best converter that I've ever run across. -David http://joshmadison.com/article/convert-for-windows Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 The best converter that I've ever run across. -David http://joshmadison.com/article/convert-for-windows Hey David, That is a real nice calculator, But I think it a VBA model. Its a shame I cannot add tabs in a regular DCL. I think that can be done in OpenDcl. I do not like the support or the lack of support for OpenDCL. Just not enough information there to please me. I could have added alot more to this calculator, But this was only meant as a demo or learning project for me. It is still a handy item to have in the drawing editor when it is needed. Anyone who wants to add more to this one is welcome to. I think this model is better than most free internet calculators I have seen so far with exception to the link you posted. Thanks for the share. The Buzzard Quote
Se7en Posted June 25, 2009 Posted June 25, 2009 Well, the way I see it, you have two options regarding the way you transfer data between the functions. (CAB's example on the Ohm Calculator was a good one to follow). You could either: Use variables that remain global through all the sub-functions, and reference each other in every function. (not my preferred method - gets quite messy). Use sub-functions with arguments, and construct the sub-functions so that the return of each is known and useable (if you know what I mean). An example of this method is shown in my line-length calculator. At the moment, you have sub-functions requiring arguments, and are supplying the sub-functions with arguments that contain unrelated data, which, at the same time you are setting to variables that you also pass between the functions... a messy amalgam of the two methods shown above. Hope this helps, Lee The first method: the variables are `global to all' but they should not be labeled as global because `global' means that the variable is not destroyed upon program completion. The method you are referring to is actually referred to as Lexical scoping and the variables are called ``free variables''. The Lexical scoping method is actually a very nice method in my opinion. It can cause some confusion for later maintenance but that can be combated with good comments. Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 The first method: the variables are `global to all' but they should not be labeled as global because `global' means that the variable is not destroyed upon program completion. The method you are referring to is actually referred to as Lexical scoping and the variables are called ``free variables''. The Lexical scoping method is actually a very nice method in my opinion. It can cause some confusion for later maintenance but that can be combated with good comments. Hey Se7en, I had mad some changes since Lee made that post. I have cleaned the program a bit and it functions well. I am still in my learning stages as well, So do not expect much from me. I just do the best I can and am willing to take suggestions. I change the program to get a string as the input and run it thru an error function then change it to a real for calculation then post it as back as a string. I hope I got it right this time. Quote
Se7en Posted June 25, 2009 Posted June 25, 2009 Hi The Buzzard, I'm still learning too. Dont expect much from you as far as what? It's your program man! Dont feel like you have to listen to anyone, its yours not theirs. I only offer a cent or two (Forgive me but I went out on a limb and said that i offer two cents because there are rare occasions that what i say is actually worth that much). Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 Hi The Buzzard,I'm still learning too. Dont expect much from you as far as what? It's your program man! Dont feel like you have to listen to anyone, its yours not theirs. I only offer a cent or two (Forgive me but I went out on a limb and said that i offer two cents because there are rare occasions that what i say is actually worth that much). I hear ya! The programs I post are not made for myself or anyone else. These are just learning exercises for me and when a decent program is produced as a result, Others will benefit from it. This is just something worth while doing. Considering the time I spent learning lisp, I have come along way, But I still have alot further to go. I prefer to do the work myself and when I get stuck, I will look for suggestions or some direction. No more, no less. Thanks Quote
Lee Mac Posted June 25, 2009 Posted June 25, 2009 Dont feel like you have to listen to anyone, its yours not theirs... Buzzard, of course, I only offer suggestions - My knowledge when it comes to programming is very limiting indeed (I do not know all the technical terms like Se7en), and so I just off suggestions based on the methods I see in use by some of the other more experienced users on here. Quote
The Buzzard Posted June 25, 2009 Author Posted June 25, 2009 Buzzard, of course, I only offer suggestions - My knowledge when it comes to programming is very limiting indeed (I do not know all the technical terms like Se7en), and so I just off suggestions based on the methods I see in use by some of the other more experienced users on here. No, please do not get me wrong Lee, If you recall I asked for suggestions and you offered. I am not saying that anyone is being a critic here. I highly regard your opinions. Sometimes there a bit over my head, But they sink in eventually. You are by far one of the few who is always ready to help and thats to be admired. The way I write a program is not carved in stone. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.