Author Topic: Writing to a file with canvas.pushDialog in it? [SOLVED]  (Read 701 times)

Solved!
Keeping this topic unlocked so others can use it for reference.


Will this line of code work? It's part of a keybind generator script.

Code: [Select]
function Jeepserver_OpenGui(%guiname)
{
   canvas.pushDialog(%guiname);
}


Visual Studio (C# 2010) seems to show a problem.

It basically is supposed to set a newly generated .cs file for a new generated keybind to open a GUI when you press the key.

%FO is a FileObject.
%funcname is the GuiControl's name that a user picked from a PopupMenu List.
« Last Edit: August 11, 2012, 08:33:26 PM by Pacnet2012² »


You forgot a backslash (\)before the "

Yeah, your quotes are wrong

Wait wait wait

Visual Studio (C# 2010) seems to show a problem.
what
if you really used vs2010 for TORQUESCRIPT (wtf) then you would get errors on every single damn line.


Which " ?
You had

%FO.writeLine("$remapCmd[$remapCount] = "Jeepserver_openGUI(" @ %funcname @ ");"");

it should be

%FO.writeLine("$remapCmd[$remapCount] = \"Jeepserver_openGUI(" @ %funcname @ ");\";");

notice how you missed a ; near the end there too?

You had

%FO.writeLine("$remapCmd[$remapCount] = "Jeepserver_openGUI(" @ %funcname @ ");"");

it should be

%FO.writeLine("$remapCmd[$remapCount] = \"Jeepserver_openGUI(" @ %funcname @ ");\";");

notice how you missed a ; near the end there too?

Oh. Also, would this other line of code have no syntax errors?

%FO.writeLine("$remapCmd[$remapCount]  = " @ %funcname @ ";");

(This is in another function, not made to do the same thing).

Oh. Also, would this other line of code have no syntax errors?

%FO.writeLine("$remapCmd[$remapCount]  = " @ %funcname @ ";");

(This is in another function, not made to do the same thing).
It would be fine.