Go to Post Let's let FIRST bring us together as a whole rather than separate us into parts eh? - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-07-2012, 12:28
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
get character from string

is there any way to have a string, lets say 10 characters long, and read each character individually?
Reply With Quote
  #2   Spotlight this post!  
Unread 07-07-2012, 13:39
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: get character from string

The typical approach is to convert it to an array of bytes and wire to a loop to index one character after the other, or to a grown index node to access many at once. The conversion functions for string are in the string palette to the bottom right.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 08-07-2012, 10:38
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: get character from string

ok thanks. after a little looking around i found out that in order to take the string of that one character and not the number, i have to use type cast (which i have never used before)
Reply With Quote
  #4   Spotlight this post!  
Unread 08-07-2012, 10:56
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: get character from string

Sorry my other post was so short -- tablets and typing ...

For a little background, a string is identical to an array of characters. So you can convert or cast it back and forth freely depending on which API is more appropriate. The string API is far better for scanning for sequences and patterns, but the array API is sometimes useful for precision work like getting out arbitrary characters and treating them as ASCII bytes.

If you want to extract a portion of a string, even a single character, but still treat it as a string, I'd suggest the string subset node. Indicate which byte and use a size of one. Another useful technique once you have a portion of a string extracted is to wire them to a case structure. The case will switch on Booleans, ints, enums, and strings. You can enter in string elements comma separated to use for matching.

If you need more assistance, be sure to explain more about what you are trying to do.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 08-07-2012, 16:58
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: get character from string

the string subset is so much easier. i forgot to use the length input before, so thats why i couldn't figure out how to do it. Thanks for all of your help
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi