From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(3,435 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
(3,435 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
(3,435 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
(3,435 Views)