Author Topic: Custom variables - Slash to backslash after project reopen  (Read 262 times)

Offline zdena

  • Multiple posting newcomer
  • *
  • Posts: 23
Custom variables - Slash to backslash after project reopen
« on: July 09, 2019, 10:41:29 pm »
Hello,
I use custom variables (created by project wizard) for a command called later from Tool+.

The command for a terminal has some parameters initiated by slash mark. See the first picture Slashes.PNG.

But if I close and load the project again, the slash marks are converted to backslash marks  :( See second picture BackSlashes.PNG.
The command doesn't work with the backslashes of course.


This problem was already reported in the past
http://forums.codeblocks.org/index.php/topic,18861.msg129252.html#msg129252
http://forums.codeblocks.org/index.php/topic,19014.msg130089.html#msg130089
http://forums.codeblocks.org/index.php/topic,21882.msg148846.html#msg148846
but without solution, if I understood well. Or did I miss something?

I also can do the calling of the terminal command any other way, but this way seemed to me the easiest.
Windows 10 64b
Arduino 1.8.5 with (modified) Arduino Builder 1.4.5 through (modified) C::B 17.12 32b
Occasional C(C++) hobbyist almost only for Arduino.
Czechia - please pardon my English

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12001
    • Travis build status
Re: Custom variables - Slash to backslash after project reopen
« Reply #1 on: July 09, 2019, 11:47:45 pm »
There was an expansion macro/variable which converted slashes. Have you tried to use it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline zdena

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Custom variables - Slash to backslash after project reopen
« Reply #2 on: July 10, 2019, 08:50:27 am »
Yes, I have.
I tried
Code: [Select]
$(APP_PATH)\teraterm-4102\TTERMPRO $TO_UNIX_PATH{\C=$(SERIAL_PORT) \BAUD=$(SERIALMONITOR_BAUDRATE) \L=$(PROJECT_DIR)Log.txt \LA=E}but it expanded as
Code: [Select]
C:\apps_Portable\CodeBlocks17ar\teraterm-4102\TTERMPRO {\C=3 \BAUD=1000000 \L=D:\KomplexCB\_Vysilani_100\Komplex00\Log.txt \LA=E}
But when I thought more about it today, I tried let the TERMINAL variable be
Code: [Select]
$(APP_PATH)\teraterm-4102\TTERMPRO \C=$(SERIAL_PORT) \BAUD=$(SERIALMONITOR_BAUDRATE) \L=$(PROJECT_DIR)Log.txt \LA=Eand the macro put in the Tools+
Code: [Select]
$TO_UNIX_PATH{$(TERMINAL)}It expands now as
Code: [Select]
C:/apps_Portable/CodeBlocks17ar/teraterm-4102/TTERMPRO /C=3 /BAUD=1000000 /L=D:/KomplexCB/_Vysilani_100/Komplex00/Log.txt /LA=E and it works amazingly partially in Windows  :-\

The terminal application started  :) but the path to the Log.txt is ignored and the file is created in the terminal folder  :(
If I try to convert the part back
Code: [Select]
$(APP_PATH)\teraterm-4102\TTERMPRO \C=$(SERIAL_PORT) \BAUD=$(SERIALMONITOR_BAUDRATE) \L=$TO_WINDOWS_PATH{$(PROJECT_DIR)}Log.txt \LA=Ethe expansion contains the { } brackets again and the backslashes inside are slashes unfortunately
Code: [Select]
C:/apps_Portable/CodeBlocks17ar/teraterm-4102/TTERMPRO /C=3 /BAUD=1000000 /L={D:/KomplexCB/_Vysilani_100/Komplex00/}Log.txt /LA=E
« Last Edit: July 10, 2019, 09:24:08 am by zdena »
Windows 10 64b
Arduino 1.8.5 with (modified) Arduino Builder 1.4.5 through (modified) C::B 17.12 32b
Occasional C(C++) hobbyist almost only for Arduino.
Czechia - please pardon my English