Skip to content

[gaml] Concatenating a string representing a path causes weird behaviours #467

Description

@lesquoyb

Describe the bug
I noticed that when I try to build a path by concatenating components of it on Windows, the string gets interpreted or something and it changes it's content.

To Reproduce
Steps to reproduce the behavior:

  1. Run this:
model testpaths

experiment e{
	
	init {
		string s <- "C:\\Users\\baptiste\\gama-capsis\\capsis-tools\\outputs\\output_file" + 1 + ".txt";
		write s;
	}
}
  1. Observe that the string printed in the console is:
    C:tiste\gama-capsis!psis-tools\outputs\output_file1.txt
    instead of
    C:\Users\baptiste\gama-capsis\capsis-tools\outputs\output_file1.txt
  2. Remove the concatenation:
		string s <- "C:\\Users\\baptiste\\gama-capsis\\capsis-tools\\outputs\\output_file1.txt";
  1. Observe that this time the string printed is correct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions