Ooops
September 22, 2021, 06:58:04

Author Topic: death to case sensitivity !  (Read 8382 times)

Offline col

  • Hero Member
  • *****
  • Posts: 592
Re: death to case sensitivity !
« Reply #60 on: June 07, 2018, 16:18:20 »
Quote
interesting to note that it is 'illegal' in c++ to do it (which is what monkey2 compiles into).
As it's 'trans-piled' into c++ you can prepend anything you want for the c++ code. It would be probably end up as something like bb_varname in c++ when the coder used _varname in the monkey code.

Online iWasAdam

  • Hero Member
  • *****
  • Posts: 2452
Re: death to case sensitivity !
« Reply #61 on: June 08, 2018, 06:34:58 »
Just had a quick look into the transpiled sources...
Code: [Select]
mx2 code
field _gameTrigger:int = 400

transpiled code
bbInt m__0gameTrigger=400;

Offline col

  • Hero Member
  • *****
  • Posts: 592
Re: death to case sensitivity !
« Reply #62 on: June 08, 2018, 20:19:08 »
Interesting that it contains a double underscore.
I can understand not starting variable names with underscore(s) as there is a general rule that they are reserved for the compiler chain, but 'containing' underscores... I'm not sure why that's a rule in c++. Meh... in the meantime... on with some coding :)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal