HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: any difference in script?  (Read 912 times)

Thazager

  • General Accounts
  • *
  • Posts: 1143
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
any difference in script?
« on: Jun 05, 17, 01:38:15 PM »

curious, is there a difference in the engine for these? Is one of them slower? Or would it be a matter of preference?
(I see these written both ways in so many places)

level = level + 1
or
level += 1
Logged

TGSRofar

  • General Accounts
  • *
  • Posts: 153
    • View Profile
Re: any difference in script?
« Reply #1 on: Jun 05, 17, 03:56:38 PM »

Unofficially speaking, I can't imagine there is a difference in execution.
Logged
Ron Farrell
Lead Programmer
Triad Game Studios

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: any difference in script?
« Reply #2 on: Jun 05, 17, 09:28:48 PM »

Yeah, I would guess it compiles to the same byte code.  I personally prefer the += style as it seems less confusing to me.

On another note, good to hear from you again, Rofar. Been a long time since I've seen you on the forums.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Thazager

  • General Accounts
  • *
  • Posts: 1143
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: any difference in script?
« Reply #3 on: Jun 06, 17, 12:15:23 PM »

Thanks guys, I like the shorter way also.
Logged

TGSRofar

  • General Accounts
  • *
  • Posts: 153
    • View Profile
Re: any difference in script?
« Reply #4 on: Jun 06, 17, 03:57:29 PM »

Thanks Scott.  I have been quiet for quite some time but have been lurking in the background throughout.
Logged
Ron Farrell
Lead Programmer
Triad Game Studios