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
filewrite(pncFile
-
josh
- Posts: 2403
- Joined: May 5th, 2014, 12:49 pm
- Location: Washington DC
Re: filewrite(pncFile
Try removing the ' around them:
filewrite(pncFile,"ServerPath=/mccdata/%DeviceID%/%UID%");
filewrite(pncFile,"ServerPath=/mccdata/%DeviceID%/%UID%");
-
jkajiba
- Posts: 8
- Joined: September 22nd, 2015, 1:40 pm
Re: filewrite(pncFile
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).
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: 2403
- Joined: May 5th, 2014, 12:49 pm
- Location: Washington DC
Re: filewrite(pncFile
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());
filewrite(pncFile, "ServerPath=/mccdata/%s/%UID%", "%DeviceID%");
or
filewrite(pncFile, "ServerPath=/mccdata/%s/%UID%", getdeviceid());