Hi, I can't work out how to ensure that a variable isn't interpreted as an integer.
I'm pulling in data from an excel spreadsheet with a car make and model in different cells then combining them.
so for example I have a spreadsheet with:
A1:Ford
B1:Mondeo
C1:2000-20005
I am then loading the spreadsheet in with DBConnect and DBQuery
however if I try and create a variable containing all three imported cells I end up with
"Ford Mondeo -5"
rather than
Ford Mondeo 2000-2005
as it's calculating the 2000-2005 rather than treating it as a string.
Forcing a variable to be a string
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Forcing a variable to be a string
I think we'd need to see the Excel file and script example. Are you able to share?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Forcing a variable to be a string
I've worked out what was happening, and learned something new in macro scheduler at the same time 
I worked out how to set a numerical calculation as a string:
let>test={"123-123"}
makes test=123-123 rather than
let>test=123-123
which is 0
however my actual issue was with DBQuery, the data was actually "- 1990-2005" with a - at the start. If you opened this csv in excel it shows the cell as "=- 1990-2005" despite no = being in the csv, this then returns the value -15 which macro scheduler accepts. so the data "corruption" was happening before it was imported, and macro scheduler seems happy to hold the variable as a string rather than calculating it.
Cheers

I worked out how to set a numerical calculation as a string:
let>test={"123-123"}
makes test=123-123 rather than
let>test=123-123
which is 0
however my actual issue was with DBQuery, the data was actually "- 1990-2005" with a - at the start. If you opened this csv in excel it shows the cell as "=- 1990-2005" despite no = being in the csv, this then returns the value -15 which macro scheduler accepts. so the data "corruption" was happening before it was imported, and macro scheduler seems happy to hold the variable as a string rather than calculating it.
Cheers