LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Alphabet Array

I have an application that needs a string array of the upper case alphabet from A-Z.  Someone previously created a string constant array, but I wanted to generate it.  This is my implementation (attached).

Is there a better way?  Also, how do you get an image embedded directly in the post instead of attached?

Thanks
0 Kudos
Message 1 of 14
(6,177 Views)
That is as good a way as I can think of to do it.
0 Kudos
Message 2 of 14
(6,174 Views)
There is no reason in the world to convert to an array inside the loop.
 
Simply do a U8 addition and typecast to a string. Voila!
 
To embed an image, attach it first, then edit the post and link to the attachment (you have 10 minutes to edit). 🙂
 
(Note that since the entire code is based on constants, it is calculated at compile time anyway.)


Message Edited by altenbach on 12-12-2007 03:46 PM
Message 3 of 14
(6,167 Views)
Here's another alternative.


Message Edited by altenbach on 12-12-2007 04:14 PM
Message 4 of 14
(6,146 Views)
Or this:


Ton


Message Edited by TonP on 12-13-2007 09:02 AM

Message Edited by TonP on 12-13-2007 09:03 AM

Message Edited by TonP on 12-13-2007 09:03 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 5 of 14
(6,108 Views)
Hi TonP!
   I apologise for my ignorance.... what function is the one you used? Is it present in some library, or is it new (after LV 😎 ?  I'm just curious...

    Have a nice day!

graziano
0 Kudos
Message 6 of 14
(6,095 Views)
It's called Ramp Pattern, and might be not in base (and yes I use 8.5)

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 14
(6,075 Views)
Hello,


I am a relative newb (using LV 8.20)
For the life of me I cannot figure out how you obtained the STRING ARRAY shown above.

Thank you for your time
jqm

0 Kudos
Message 8 of 14
(6,061 Views)
Well, if you mean my code it consist of 2 functions:

First I create an array of floating point numerics, that start at 65 runs to 90 with 26 elements. Second I convert it into a string of ASCII.

If you mean Altenbach's first code segment:
This runs in a for loop that runs 26 tims.
It takes the iteration number, convert it into an 1 byte unsigned integer, adds 65 (A in ASCII) and converts the data type from U8 to string.
At the end of the for loop the data is auto-indexed into an array of strings.

Altenbach's second code is a variation on this using a shift register.

Try for yourself to create a fourth method!

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 9 of 14
(6,056 Views)
Hello,

Sorry, I may not have been clear. 
I dont know where the STRING ARRAY is on the function pallette.  So I am unable to recreate as shown by altenback's example.

thanks
jqm
0 Kudos
Message 10 of 14
(6,051 Views)