NetTalk Central

Author Topic: Naming of webcam pics with date format  (Read 5317 times)

Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Naming of webcam pics with date format
« 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


Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Naming of webcam pics with date format
« Reply #1 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

?

Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: Naming of webcam pics with date format
« Reply #2 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Naming of webcam pics with date format
« Reply #3 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


Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: Naming of webcam pics with date format
« Reply #4 on: June 06, 2019, 02:40:06 AM »
Thanks Jane and Bruce.
Richard