cancelar
Mostrando resultados para 
Pesquisar então 
Você quer dizer: 

truth or dare- gaming code

Resolvido!
Ir para a solução

how can we create a database or questions { a place where some set of pre-defined data is kept } and also to retrieve information randomly and display n the front panel?? 

Anyone please help me out in creating a pre-defined database and retrieving that information randomly 

0 Kudos
Mensagem 1 de 10
4.424Exibições

You already started down the simple route: use a simple text file.  Each line in the text file should be a new question.  If you right-click on the Read From Text File, you will see an option to "Read Lines".  Enable that and set your number to read to -1 (read all lines).  You will now have an array of questions.

 

Now you just have to figure out the randomization.  There are plenty of examples on that, but see how far you can get and let us know where you are stuck.



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
0 Kudos
Mensagem 2 de 10
4.389Exibições

though.. i select read all lines also , the obtained result form the text file to labview is in different language i.e i mean the result is showing in different format not as it is given in the text file also how to obtain randomly those queries from the text file ?? help me out how to randomise if possible provide some info abbout randomisation methods ??

0 Kudos
Mensagem 3 de 10
4.356Exibições

Hi ivan,

 

the obtained result form the text file to labview is in different language i.e i mean the result is showing in different format not as it is given in the text file

Does LabVIEW translate the text from one language to another language? I don't believe this… 😄

Does you text contain any Unicode characters? LabVIEW isn't good at handling such char encodings and reads your text as plain ASCII by default!

(Maybe you should provide your VI and an example text file to help us solve your problem…)

 

help me out how to randomise

There is a random() function in the numerics palette…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Mensagem 4 de 10
4.353Exibições

different language means .. there is a different format showing in string (result) indicator 

0 Kudos
Mensagem 5 de 10
4.350Exibições

Hi Ivan,

 

unfortunately I can only open VIs for upto LV2014 right now, so you need to down-convert your VI and attach it again (file menu -> save for previous)…

And please also attach your text file!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Mensagem 6 de 10
4.348Exibições

here i selected some random question in the text file .. also with previous version vi 

Baixar tudo
0 Kudos
Mensagem 7 de 10
4.344Exibições
Solução
Aceita por ivanjoel

Try saving in a text format, instead of a Word format. For example, "t_and_d.txt" with the same data will be much easier to parse.


GCentral
0 Kudos
Mensagem 8 de 10
4.331Exibições

Greetings ! 

i would like to select a random line from the given text file without taking the empty spaces .i.e it is taking empty spaces also though i specified read lines in read from text file icon .

Is there any option to make like 'it should only take the lines upto which i specified but not going beyond which results in empty spaces in the display.

0 Kudos
Mensagem 9 de 10
4.280Exibições

I have a VI that specifically goes through the array of strings and removes the empty strings.  This is what I recommend you do.



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
0 Kudos
Mensagem 10 de 10
4.276Exibições