hello,
i have a file with a number in each line, but when i use the command:
ReadLn>file.txt,line,number
the number variable is returned as string, and i cannot do mathematical calculations on it (which i need). What is the fastest way to force integer, or convert string to int ?
Had anyone got a solution for that?
string to integer
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Strings/numbers are interchangeable in Macro Scheduler. However, if you have any spaces or other characters in the string it will not work as a number.
So that maybe your issue. Try:
ReadLn>file.txt,line,number
Trim>number,number
If that doesn't work there must be some other hidden character in there.
So that maybe your issue. Try:
ReadLn>file.txt,line,number
Trim>number,number
If that doesn't work there must be some other hidden character in there.
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?