LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CREATING RANDOM ELEMENTS

Solved!
Go to solution

THE MAGIC TEXT INTIALIZED AS ABCD,AND I HAVE TO CREATE 50 RANDOM ELEMENTS FROM THAT TEXT..CAN ANYONE HELP ME

0 Kudos
Message 1 of 35
(8,018 Views)

FIRST TURN OFF YOUR CAPS LOCK KEY.  CAPS LOCK BLOCKS MAGIC.

 

There, that is better.

 

Now describe your problem in a way we can understand.  What is "magic text"?  What do you mean by "ABCD"?

 

Post some examples of what you have and what you are looking for.

Message 2 of 35
(8,006 Views)

If the file does not exist, the Magic Text is initialized to a random sequence of 50 capital letters from the latin characters “ABCD” (e.g., “BDACCCBABADBDABDA...”). 

0 Kudos
Message 3 of 35
(8,000 Views)

I want to know how to generate 50 random latin characters.

0 Kudos
Message 4 of 35
(7,997 Views)

Do a search for random number on your functions palette and go from there.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 35
(7,991 Views)

Look in your string palette.  There are VIs like String Subset and Index String Array you can use to pick a random (random is in the Numeric palette) element from a string.  Then just put it in a for loop and loop 50 times to concatenate a random string of your elements.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 6 of 35
(7,985 Views)

no ,i didnt find solution from your answer ,i dont want random characters,i just want ABCD letters bcddadd.....=50.

0 Kudos
Message 7 of 35
(7,973 Views)

i dont want to run n=50,i jst want  50 capital letters from abcd

0 Kudos
Message 8 of 35
(7,964 Views)

You should be able to do what you need to do with the information we gave you - IF you are actually trying to solve the issue and not just hoping someone does it for you.

 

THINK... random number from 1-4 in a loop that executes 50 times...  There, I've gotten you started...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 35
(7,958 Views)

@balbal207 wrote:

i dont want to run n=50,i jst want  50 capital letters from abcd


Generate a random number from 0 to 3.  Then use Array Index to pick your letter (A, B,C, and D stored in an array of strings).  Use autoindexing to create an array of strings for your characters.  You can then use Concatinate Strings to turn it all into a single string.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 35
(7,954 Views)