Escape characters

Hi,

I'm trying to copy files to a network drive (i.e. \\RemoteServer\D$). I get an error when FinalBuilder parses from \\%TargetServer%\D$ to \\\D$,

whereas %TargetServer% is the variable that holds the name of target server.

Any help is appreciated.

Hi Hung,

Sorry to hear you’re having problems. What action are you using to copy the files? Are you sure that the TargetServer variable has been initialised to the proper values?

(Hint: You can use a Log Variable Values action to quickly see the value of a variable at runtime.)

Regards,

Angus

I used Copy File(s) action. When I have my mouse over it, it shows the correct path. \\DEV\D$\...

\\%TargetServer%\D$\Interface.NET\DeviceServerService

Copying files : C:\Build\05.15.03\Compiled\Interface.NET Framework V1.0\DeviceServer\WinService\*.* -> \\\D$\Interface.NET\DeviceServerService
Failed to copy File : C:\Build\05.15.03\Compiled\Interface.NET Framework V1.0\DeviceServer\WinService\Hilton.PM.AppServer.BE.dll -> \\\D$\Interface.NET\DeviceServerService\Hilton.PM.AppServer.BE.dll
Win32 Error : You were not connected because a duplicate name exists on the network. Go to System in Control Panel to change the computer name and try again
0 Files Copied.

Hi Hung,

It looks like the %TargetServer% variable is blank when the Copy File(s) action is running. Try adding a watch on that variable and a breakpoint on the Copy Files action so you can inspect the value of the variable before the action runs. Is it possible that the TargetServer variable is being set to blank by one of your other actions?

.t8

I have to add a "Set Variable" action to set it explicitly and it works. Thanks.

I also have an unrelated question. I want to get source code from SourceSafe by label. I set %BuildVersion% to 00001, but it is interpreted as 1 with leading zeros ommitted. How do I have leading zeros included? Thanks.

Hi Hung,

Firstly, about the variable value issue. In FinalBuilder each variable has a Default Value and a Current Value. You can also choose which of these you want to see in the UI when you hover over a field that contains a variable - the setting is in Tools menu | Options | FinalBuilder category | Variables | Design Time Variables.

As for variable types, by default FinalBuilder tries to figure out what type a variable is, so in this case it’s identified 00001 as an integer. What you need to do is use the “Set Variable” action and then use the “Force Type” options at the bottom of the dialog to force it as a string.

hth.
.t8

I have it resolved. Thanks.