December 06, 2021, 05:27:17 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: [1]

Author Topic: Developer Questions  (Read 2545 times)

juicebox360

  • Guest
Developer Questions
« on: February 15, 2009, 11:23:54 pm »

Is it possible to concatenate a global string and a local string? Namely,
Quote
global.map_Description += map_Description;

When I come across the function that uses this operation, GM gives me this error
Quote

___________________________________________
ERROR in
action number 1
of Mouse Event for Left Pressed
for object Button:

In script button_action:
In script load_Description:
Error in code at line 15:
           global.map_Description += map_Description;

at position 10: Wrong type of arguments to +.

Any help is appreciated, thanks.
Logged

juicebox360

  • Guest
Re: Developer Questions
« Reply #1 on: February 15, 2009, 11:59:42 pm »

Okay, I forgot that that means they have to be the same types of data, so I
Quote
string(global.map_Description) = string(global.map_Description) + string(map_Description);

Now it gives me
Quote

___________________________________________
COMPILATION ERROR in Script: load_Description
Error in code at line 14:
           string(global.map_Description) = string(global.map_Description) + string(map_Description);

at position 41: Unexpected symbol in expression.


EDIT: If I use the operator "+=", it gives me the same error.
« Last Edit: February 16, 2009, 12:01:51 am by [BTD] juicebox360 »
Logged

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 11006
  • Dust in a box under a table
Re: Developer Questions
« Reply #2 on: February 16, 2009, 12:02:47 am »

didja try ==?
i dunno, its been(Sp?) a while since i've dabbled in code.

juicebox360

  • Guest
Re: Developer Questions
« Reply #3 on: February 16, 2009, 12:09:59 am »

didja try ==?
i dunno, its been(Sp?) a while since i've dabbled in code.
lawl

If I use ==, I can't accumulate the string. Also, == is used to check if something is equal, and = is used to assign data to variables.
Logged

juicebox360

  • Guest
Re: Developer Questions
« Reply #4 on: February 16, 2009, 12:36:52 am »

Ah, I figured it out, but the whole routine isn't working.

I was working on map descriptions, and it isn't working...at all :ninja:

HELP ME, cspotcode
Logged

cspotcode

  • Coder
  • Administrator
  • *****
  • Karma: 134
  • Offline Offline
  • Posts: 411
Re: Developer Questions
« Reply #5 on: February 16, 2009, 04:05:27 pm »

You said you figured out that bug, so what's the problem?  I don't know what your code is doing.
Logged
"The knack of flying is learning how to throw yourself at the ground and miss."
- Douglas Adams

Chris P. Bacon

  • Administrator
  • *****
  • Karma: 195
  • Offline Offline
  • Posts: 770
  • Retired gg2 dev
Re: Developer Questions
« Reply #6 on: February 17, 2009, 02:37:15 pm »

global.map_Description = string(global.map_Description) + string(map_Description);

perhaps???
Logged
Pages: [1]
 

Page created in 0.05 seconds with 35 queries.