There appears to be a mess in this code, but I am not sure what it is. Firstly the Get is a command and should not have an underscore after it joining it to another word. the variables are not written correctly; should be t or g prefixed. The code does not work as expected. "initialise and 'display' and 'calculate' are not in the dictionary yet they are placed as commands.
I just need to know whether to carry on with this pdf tutorial, or whether I have incorrectly misinterpreted the above.
Chris
Something wrong with this code?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Something wrong with this code?
Since you have declared all variables as global variables, at the top of your script... why do you reuse the same var names as parameters, for each command ?
No need.
No need.
Re: Something wrong with this code?
Hi, I did not, this is a tutorial, and I was getting confused (as a beginner - complete novice); yet I felt there was somethings not quite accurate but could not be concrete about it. So thankyou for that input - much appreciated.
Re: Something wrong with this code?
Hi Chris,
But yes, using meaningful prefixes would be good style
Hope that helps!
Best
Klaus
True, but this is a custom handler named "get_whatever_..." and NOT the actual "GET" command!chris25 wrote:Firstly the Get is a command and should not have an underscore after it joining it to another word.
Well, there are no STRICT rules on how to name variables, so this is all correct!chris25 wrote:the variables are not written correctly; should be t or g prefixed.
But yes, using meaningful prefixes would be good style

Sure? Sorry, did not try it...chris25 wrote:The code does not work as expected.
These, too, are custom handlers and thus they do not appear in the LC dictionary!chris25 wrote:"initialise and 'display' and 'calculate' are not in the dictionary yet they are placed as commands.

Hope that helps!
Best
Klaus
Re: Something wrong with this code?
Hallo Klaus, thankyou, you have cleared things up, now due to this I think then he must have pre-prepared stacks for his students with extra code written in, so this explains a lot. Thankyou for clarifying about the custom handlers, was just reading about this earlier, but did not recognise them here - silly me.