Jump to content

Sody

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sody

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, I am using Chinese Windows OS, and try to use function process (FProcess) to execute external script. It seems FProcess runs OK, but the Console does not show the error message correctly. It looks like: *** INFO Process : started ... [D:\\test.bat] hello world ����: ��֧���������¶����������˳��˽��̡� *** INFO Process : finished [exit code 0] The codes in feature definition are quite simple. They are string exe("D:\\test.bat") process mytool(exe) mytool.run() And the test.bat is also very simple. It is @echo off echo hello world timeout /t 10 /nobreak >nul The error message shows when the timeout line is executed, which shows like a list of question marks. I guess it is because the Console window does not support utf-8 characters. It would be much easier for me to debug the codes if the Console window could show correct message. By the way, instead of Software Connector, the reason I use FProcess to get info from external program is that the amount and positions of datas in the input.txt are not fixed. I have tried to use runProcessBlocking to execute the external script, but there is very limited infomation about this function from the documentation. I don't know if there is any example in the tutorials. If you could give some simple examples about runProcessBlocking, it would be very helpful. Thanks.
  2. Thanks Heinrich, I agree that no setting of seed is a problem. I will rember to be careful if I need to generate random number with rand().
  3. Hi, I am a new user following the tutorials step by step. I have tried the Case-by-Case Analysis , and I doubted about the values generated by the function rand(). So I slightly changed the code as shown below to show the exact random number. double value_base(rand()*100) integer value(value_base.toUInt()) integer difference(abs(value - try)) echo(" ") echo("Random number is " + value_base) echo("My try is " + try) if (difference == 0) echo("congratulations, you are spot on!") else echo("No, that was not the number.") echo("The number I was thinking of was " + value) endif The feature runs OK. The result is showed in terminal like: I kept testing this feature with input "try" from 1 to 40, and collect the random number generated. They are like: try Random number try Random number try Random number try Random number try Random number 1 80.8741 2 80.8741 3 58.5009 4 80.8741 5 89.5962 6 19.3304 7 56.3585 8 47.9873 9 58.5009 10 19.3304 11 0.125126 12 58.5009 13 35.0291 14 47.9873 15 19.3304 16 19.3304 17 56.3585 18 80.8741 19 0.125126 20 19.3304 21 80.8741 22 47.9873 23 35.0291 24 19.3304 25 58.5009 26 80.8741 27 89.5962 28 56.3585 29 80.8741 30 58.5009 31 58.5009 32 47.9873 33 58.5009 34 80.8741 35 89.5962 36 58.5009 37 47.9873 38 82.284 39 80.8741 40 19.3304 Obviously some values were repeatedly generated, as shown in colors above, and the values were not uniformly distributed. My OS is Windows 11, and my caeses version is 5.3.4 . I am not sure if I used the function rand() properly. Could someone tell me what is wrong here? complete console output.txt
×
×
  • Create New...