Dear all,

When running this sample code

g = "error";
while g== "error"
   G = input("Input letter a: ", "string")
   select G
   case "a"
       g = 1
   else
       g = "error"
       mprintf("Incorrect data; Try again.\n");
   end
end

which includes an input inside a while loop, the problem is that after entering the right 
answer the letter "a",
and pressing Enter the execution stays in an idle state until one presses Enter 
again.

Is there a way to prevent this?

Besides, if I run this version without the loop

g = "error";
G = input("Input letter a: ", "string");
select G
case "a"
   g = 1
else
   g = "error"
   mprintf("Incorrect data; Try again.\n");
end



it appears that after the input clause the following line, "select G", is 
assumed to be the interactive answer,
so not only the prompt isn't presented to the user bur a syntax error is 
created as the case clause
appears without the corresponding select clause. This happens when selecting 
the code, right-clicking
and choosing "Evaluate selection with echo"


Any idea of what may be happening?

If I add a line after the input clause including the expected input, i.e. a, 
then the idle state doesn't
appear and the command is completed and the control restored without an 
additional Enter.

Thank you.

Regards,

Federico Miyara



[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
      Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users

Reply via email to