New Zealand
Asked — Edited

Split Function Query

Hi Dj Sures...

I've been playing around with the split function for the last couple of days writing an automated announcement routine that simply reads from a long list of dates with attached comments so that my bot can remind me of birthdays, etc.

While doing so I noticed an interesting behaviour with the SPLIT() function.

It seems that when I import a preformatted date from my comma delimited txt file it comes in as a txt data but it is treated as a math formula when split.

Ie I have written to a txt file a date and a comment to be spoken when imported from the txt file and assigned it is read as simple text I have: $Announce_Date,Announcement "21/01/2013,Hello DJ Sures"

but when I Split($TXT,",",1) the date information is calculated as 25 divided by 12 divided by 2013 eg. "0.000866336633663366"

Is this intentional?

I would have thought that I would have to do post processing on my text data rather than the EZ-Script so a date coming in as txt remains as txt until I assign it to be a date!

My work around was to write the date as three integers: $Announce_day,$Announce_month,$Announce_year,$Announcement 21,1,2013,Hello DJ Sures

Works fine!

What are your thoughts.....?


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

#1  

Hmmm. Date, time, millisecond time functionality is definitely needed. I have messed around with calculating time diffs, it seems unnecessarily time consuming. I've been trying to conceptualize ARC vs sdk stuff. Been into hardware a lot getting a robot to work with. I'm gonna start putting a lot more time into ARC real soon so should have more insight into development.

PRO
Synthiam
#2  

I made it so any data read can also be math equations. That way you can perform your realtime math within the file. You'll need to use a different delimeter for the date, perhaps a period as used in many date formats:)

New Zealand
#3  

Awesome thanks DJ ... the knowing makes the doing easier.

PRO
Synthiam
#4  

Also i should add, that proper CSV puts strings in "quotes". If the value is not in quotes, then it will be numeric and therefore be calculated.

Put the date as a string by surrounding it in "quotes" and you'll be fine:)