LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alphabet_Order

Solved!
Go to solution

Hi, I need some help! I'm trying to list/retain each letter in the alphabet in Column 0 of the appended array shown. Each time I press the Key-In "OK" Button a letter of the alphabet should appear - and does, but I need another shift register or sequence structure to retain each letter as:

a = 1

b = 2

c = 3

.

.

.

I don't want to make this over complicated - but it might be too late...lol.

Download All
0 Kudos
Message 1 of 8
(331 Views)

Not sure what are you trying to achieve. You can convert number to ascii character.

ZYOng_0-1766037452147.png

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 8
(282 Views)
Solution
Accepted by _Phobos

Maybe something like this?

 

altenbach_0-1766039136310.png

 

0 Kudos
Message 3 of 8
(271 Views)

This appears to be a "homework" problem, which you have restated in such a way that it is unclear what you are supposed to be doing (and thus difficult to help you understand how to approach this problem).  

 

Why don't you post the assignment itself?  Is there a "timing" requirement?  What is "Key In" supposed to do?  Are you supposed to create a 1D Array of Strings that start with "a = 1" and end with "z = 26"?  Are you supposed to create a 2D Array of Strings, the first column of which contains "a" to "z" and the second column contains "1" to "26"?  Why are there timers in your code?

 

Have you discussed this with your Professor?  with your Classmates?

 

Bob Schor

0 Kudos
Message 4 of 8
(232 Views)

Thank you! Just out of curiosity, how did you think - to take this approach? And I see that you're using a "96" unsigned byte constant. What does that accomplish? 

0 Kudos
Message 5 of 8
(216 Views)

Thank you for your response and showing clarification 97 is asci "a"! Much appreciated!

0 Kudos
Message 6 of 8
(211 Views)

btw. ZhiYang-Ong answered my question about the 96 unsigned byte constant - fyi.

0 Kudos
Message 7 of 8
(210 Views)

@_Phobos wrote:

Thank you! Just out of curiosity, how did you think - to take this approach? 


I have over 50 years programming experience and seen it all, so this took literally seconds for me. There are thousands of equally valid possible approaches. Now you got a starting point, so try to come up with five more solutions as an exercise! Try it and make sure it works.

 

Study every detail of the solution. Why do we convert to U8? What does typecast do, exactly? Why is N=26? Why is there a wait because it "seems" to work equally well without it? etc.

 

Now rewrite it (1) using an event structure, (2) using a singe loop, (3) so it goes back to step one after all characters are shown, (4) modify it so it produces uppercase letters, (5) modify it so the output is a single string adding a line with each step. (6), modify it so it stops automatically after all lines are displayed, (7)... etc.

 

If this is homework, be aware that your teacher reads this forum so make sure to do some creative changes and be prepared to answer any questions about any part of the code.

 


@_Phobos wrote:

And I see that you're using a "96" unsigned byte constant. What does that accomplish? 


Study this, maybe you see a pattern. 😄

 

0 Kudos
Message 8 of 8
(201 Views)