NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Richard I on June 05, 2019, 04:52:36 PM

Title: Naming of webcam pics with date format
Post by: Richard I on June 05, 2019, 04:52:36 PM
hello
I am naming webcam photos on save, with this string:
loc:filename = p_web.RenameFile('Bedroom2Picture',p_web.GSV('pro:propertyname')&'.'& p_web.GSV('Cab:CabinID')&'.'& p_web.GSV('Bed2:InspectionDate')&'.png')

all good except the date is not formatting as @D6

I have tried using p_web.Formatvalue(bed2:Inspectiondate,'@d6') but that drops it completely  ??

thanks
Richard

Title: Re: Naming of webcam pics with date format
Post by: Jane on June 05, 2019, 05:12:48 PM
Since this is all Clarion string concatenation code, have you tried

blahblah & format(p_web.GSV('Bed2:InspectionDate'),@D6) & blahblah

?
Title: Re: Naming of webcam pics with date format
Post by: Richard I on June 05, 2019, 09:19:46 PM
Hi Jane,
Thanks
Yes I have, - the date in any format wasnt visible
without the format I get the date as a clarion long

Cheers
Richard
Title: Re: Naming of webcam pics with date format
Post by: Bruce on June 05, 2019, 10:31:49 PM
>> all good except the date is not formatting as @D6

you're not calling format on that line, so no reason to expect it would be formatted...

>> p_web.Formatvalue(bed2:Inspectiondate,'@d6') but that drops it completely  ??

bed2:Inspectiondate is blank there, so one would expect that to be blank.

have you tried;

loc:filename = p_web.RenameFile('Bedroom2Picture',p_web.GSV('pro:propertyname') & '.' & p_web.GSV('Cab:CabinID')&'.' &  format(p_web.GSV('Bed2:InspectionDate'),'@d6') & '.png')

(ie - what Jane said...)

I think you will find that works. [except that...]

Also I recommend you use '@D012' not @d6.
@d6 suffers from 2 problems - firstly it contains the / character, which will cause pain to you later on because / is not a character allowed in URL's. So at the very least use '@D06-'. D12 would be better because it has no separators, and sorts y/m/d which means the files will appear in date order when sorted by name.

cheers
Bruce

Title: Re: Naming of webcam pics with date format
Post by: Richard I on June 06, 2019, 02:40:06 AM
Thanks Jane and Bruce.
Richard