LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert string to integer?

I had get date string: "1/14/2000" ,
Now I want to get the integer numbers: Year=2000, Month=1 and Day=14
Help me!

---A newbie


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 1 of 4
(4,065 Views)
Use 'Scan From String' function from the 'STRING' functions menu:

[Image]


-Franz




hotoo@my-deja.com schrieb:

> I had get date string: "1/14/2000" ,
> Now I want to get the integer numbers: Year=2000, Month=1 and Day=14
> Help me!
>
> ---A newbie
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
0 Kudos
Message 2 of 4
(4,065 Views)
On Fri, 14 Jan 2000 10:59:51 GMT, hotoo@my-deja.com wrote:
>I had get date string: "1/14/2000" ,
>Now I want to get the integer numbers: Year=2000, Month=1 and Day=14
>Help me!

have a look at the string function "Scan From String".
Set the format string to "%d/%d%d"
Make the function to have three outputs terminals.
I would also advise to connect a dummy integer to the three default
terminals.
To get some error checking on the conversion check the error out
terminal.

--
Rolf
0 Kudos
Message 3 of 4
(4,065 Views)
Hello mister newbie :),

Here's a VI what will do the job. Scan from string is very powerfull for
this kind of jobs.

Happy wirering,
Roger


hotoo@my-deja.com heeft geschreven in bericht
<85mvj3$kr1$1@nnrp1.deja.com>...
>I had get date string: "1/14/2000" ,
>Now I want to get the integer numbers: Year=2000, Month=1 and Day=14
>Help me!
>
>---A newbie
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.



[Attachment $_string to int_date.vi, see below]
0 Kudos
Message 4 of 4
(4,065 Views)