Is this a lua Error?

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: Ralph, russ

Message
Author
User avatar
jph
Posts: 2030
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Is this a lua Error?

#11 Post by jph »

The Artful Dodger wrote: Wed Aug 17, 2022 10:49 am

I also know to insert lots of comments - what effect they have on an interpretative language I don't know.

absolutely none at all apart from making it easier for you to read and understand in 6 months time...... why should they have any other effect? :?

of course, they may be used in evidence against you at a later date, or the feds or space aliens may read them.. :o - so maybe follow the path that offers the least paranoia :lol:
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

The Artful Dodger
Posts: 79
Joined: Sat Jul 09, 2022 3:20 pm

Re: Is this a lua Error?

#12 Post by The Artful Dodger »

It makes a big difference - in most interpreted languages, each statement, unless it has been "pre-processed" (which some do for just this reason), has to be read and "interpreted" - is this a comment (which I can ignore) or is it a statement (which I must process). So, providing a large number of comments adds to the time required by the processor to finish a function!

Sparky

Paranoia has nothing to do with facts!

User avatar
jph
Posts: 2030
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Is this a lua Error?

#13 Post by jph »

The Artful Dodger wrote: Wed Aug 17, 2022 12:03 pm It makes a big difference - in most interpreted languages, each statement, unless it has been "pre-processed" (which some do for just this reason), has to be read and "interpreted" - is this a comment (which I can ignore) or is it a statement (which I must process). So, providing a large number of comments adds to the time required by the processor to finish a function!

Sparky

Paranoia has nothing to do with facts!
Rest easy at night - with or without hat, it will make ABSOLUTELY NO DIFFERENCE AT ALL !
The Vic 20 was so yesterday. :lol: It was more a case of tape usage and data transmission in general that comments were minimised . fact

I worry that you worry so much about worrying about so much. I have a colleague who worries when he has nothing to worry about hence never gets to that stage. He tried to insure himself against not being insured, now worries about that also.
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

User avatar
Keith Baxter
Posts: 3766
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Is this a lua Error?

#14 Post by Keith Baxter »

Hi,

It is all about managing your data.

Always put checks into your code. @Corjan taught me that when I was asking about static data and other map queries and we were loading queries from those data sources. Often those data sources returned a "nil" and the code would hang or create errors.

All local and global variables need to have a "VALUE" before any form of manipulation.

With large instruments I use a bits_and_bobs.lib() and maybe also a tables.lib()

The load order of your lib files are not important. It is how the logic.lua file calls each library. Z order is king and you will always get errors if a var has a nil value or if a value is of an incorrect type.

I am happy to do a session on the discord any night and all interested are welcome to participate.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply