filewrite(pncFile

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
jkajiba
Posts: 8
Joined: September 22nd, 2015, 1:40 pm

filewrite(pncFile

Post by jkajiba »

Dear All

I am trying to see if it is possible to pass values of DeviceId and UID to a filewrite function.

eg: filewrite(pncFile,"ServerPath=/mccdata/'%DeviceID%'/'%UID%'");

John
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: filewrite(pncFile

Post by josh »

Try removing the ' around them:

filewrite(pncFile,"ServerPath=/mccdata/%DeviceID%/%UID%");
jkajiba
Posts: 8
Joined: September 22nd, 2015, 1:40 pm

Re: filewrite(pncFile

Post by jkajiba »

Dear Josh

After removing ' . I am getting below warnings

WARNING: Number of '%' arguments passed (0) does not match the number expected in the message text (1).
WARNING: Number of '%' arguments passed (0) does not match the number expected in the message text (1).
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: filewrite(pncFile

Post by josh »

Sorry. I forgot that it would try to interpret the '%D' in '%DeviceId' as if it was %d and it is looking for a replacement. Try the following instead:

filewrite(pncFile, "ServerPath=/mccdata/%s/%UID%", "%DeviceID%");

or

filewrite(pncFile, "ServerPath=/mccdata/%s/%UID%", getdeviceid());
Post Reply