Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 10th, 2025, 5:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to detect an empty text variable?
PostPosted: June 26th, 2006, 1:37 pm 
Offline

Joined: November 8th, 2004, 5:23 pm
Posts: 279
Opus: Opus Pro 9
OS: Win 10/64
I have created a simple test in which the user has to put in one or two words as an answer.

I have set a variable "v_correct_answers" which contains two correct answers.

Then I put the user input into a variable "v_users_answer".

Then I check if "v_correct_answer" contains at least one word of "v_users_answers". This works fine ... but:


How can I check if the user has put nothing in the text input box?

I tried this with an if condition "if v_users_answer="" then" but cannot detect the empty text field in this way.

Instead the above mentioned contains-condition detects the empty field as true although none word of the comparision variable "v_correct_answers" is contained in the empty user answer.

T.

_________________
Opus Pro 9.75, Win 10/64, 8 GB RAM, Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.4GHz, NVIDIA GeForce GTX 660 Ti, Roland OctaCapture


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 26th, 2006, 2:00 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
Code:
if (VARIABLE=='')
{
...
}

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 26th, 2006, 2:05 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
You can also do it using just actions.

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 26th, 2006, 2:29 pm 
Offline

Joined: November 8th, 2004, 5:23 pm
Posts: 279
Opus: Opus Pro 9
OS: Win 10/64
bwpatric wrote:
You can also do it using just actions.


... thanks for your help. I tried it this way but first it did not work. I have now deleteted all actions an did it again and now it works fine :D

Also the wrong detection of the correct answer works now as it should. I don't know why but something went wrong with the variables.

Thanks again!

T.

_________________
Opus Pro 9.75, Win 10/64, 8 GB RAM, Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.4GHz, NVIDIA GeForce GTX 660 Ti, Roland OctaCapture


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 90 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group