-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Love it but Missing doc #4
Comments
Hi Michal, Thanks for the nice words! There is no doc yet, but you can check out a few CSCS examples at https://github.com/vassilych/cscs/tree/master/cscs/bin/Debug/scripts There is also a repository for mobile development in CSCS for iOS and Android (via Xamarin): Also, you can check out a free E-book describing CSCS: And a few articles: Thanks and looking forward to your feedback, |
Hello, Still not sure how to add custom command and his function. :( In this article : http://www.codemag.com/Article/1607081/How-to-Write-Your-Own-Programming-Language-in-C# , i did try and it works ok, but it is a bit different then this on git. What i did: Add contant in Constants.cs Then add my own function class in FunctionsOS.cs And then register it in Interpreter. But keep saying cannot parse it :(.... Can you please write some doc how exactly to add it pls ? I was trying to implement ping as example.. Not sure what else need to be done, i was thinking this is all. Also it would be great to explaination if want to add custom function with more then 1 para.. Getting this : Couldn't parse [ping"127.0.0.1"] in StringOrNumber Thx a lot |
Also found the bug, once i assing string its print it to console output why ? |
Another bug: |
Hi, --> Getting this : Couldn't parse [ping"127.0.0.1"] --> example: $ip = "127.0.0.0"; will print ip to console, but it is not wanted to work like this.. --> if else does not work.. Couldn't parse [else] in StringOrNumber Also, take a look at the source code how a simple function is implemented, e.g. sin(). All the best, |
hmm well, I have to say it does not work at all.
Pls try it yrself. It is not work... BTW in your examples u have used if else commands, look at here: Another thing is, output result is in revers order :(... |
You are using elif instead of else. "elif" is used instead of "else if" in a condition. ip = "127.0.0.1"; |
Ok thx all working now. Another question how can i concat string pls ? Example: machine = import(); print(file_to_check); |
i cannot use "\" this always get me cannot parse it.. :( But is there a way to make it work ? |
You can concatenate strings just with a "+", e.g.: file_to_check = "\"; is not a valid string (in any language). If you want to include a quote into the string, it must be: |
No my point was to use "\\" i need to save into variable double backslash.. |
ah, ok, then use file_to_check = "\\"; for a backslash and file_to_check = "\\\\"; for a double backslash. |
Wrong parse, it wont take it.. :( Couldn't parse ["\\\\";] in StringOrNumber |
Cut and paste the whole code snippet that doesn't work for you and explain what final strings you expect - then it should be easy to fix. |
This , but not matter what it wont parse it in any case when i use even single \ \\machine\c$\Program Files\Company\Client\app.exe and this i want to save it into variable |
x = "\\\\machine\\c$\\Program Files\\Company\\Client\\app.exe"; |
No it does not work as excepted. Machine is variable string with ip or pc name in it.. x = "\\"; print(x); return cannot parse |
Have you find the solution for this pls ? |
Just look at the examples I pasted in this thread. For the one that you need now the correct code is: a="\\\\machine\\c$\\Program Files\\Company\\Client\\app.exe"; You just always need to protect a backslash with another backslash. |
No it does not work try it pls... :( it is a bit frustrating machine = "127.0.0.1"; a = "\\\\machine\\c$\\Program Files\\Company\\Client\\app.exe"; It will print this: but expected result should be 👍 So it does not work at all... |
How would it know that the "machine" is not a constant but a variable? You should do this: machine = "127.0.0.1"; |
Well i have try this of course, giving error during the parsing. Just pls try it on your own. it wont work. No matter ill try still could not parse it. But if i use this / it works and i can save it in variable.. |
ok officially try everything, u cant simply conecat "\\" + machine... there is no way to do it.. |
Hi Vassilych, Thanks again, Kind Regards, Murat |
Hi Murat, Thanks for kind words! But I don't think I quite get what you mean. Could you elaborate? Also, for instance, how can you run multiple scripts, say in Python? Thanks, |
Hi Vassili, Do you have any advice for this? Thanks, Murat |
Hi Vassili, |
Hi Murat, Yes, it has been completed. If you define variables, like c=1; c will be global, as before. But if you want to define them locally, just in one file, do DefineLocal(varName, initValue); e.g.: DefineLocal("myVar", 1); Then as long as you use myVar or x, it will be in the local scope only... By the way, you can also use a debugger with CSCS and also a REPL evaluator with CSCS with Visual Studio Code. Cheers, |
Hi Vassili, Many thanks for your help. Kinds, Murat |
Hi Murat, No, running exactly the same script file in multiple files is not supported yet. Thanks, |
Hi Vassili, I mean that I would run several scripts in one application. So these scripts can run independently and each script holds their values independently. I want to use Interpreter as a class. For each script, I would create a new Interpreter class and I can use them independently. Is it clear? Thanks, |
Hi Murat, Yes, your point is clear and the ask is reasonable. Unfortunately, this is not supported yet, but it would be a good idea to implement (but it would take rather a long time, at least a few months)... Best, |
Hi Vassili, Many Thanks, Murat |
Dear Vassili,The following example : b=-2;print(-b);Couldn't parse [-b] in StringOrNumber. It seems scsc doesn't Identify variable b, though it can use print(-1*b) instead。how to fix and make the problem simpler? |
Hi there, |
Dear Vassili, I define a function like this : UserFunction("Info",{100,0},{200,0},23.3). The problem is CSCS doesn't parse the arguments correctly, "List args = script.GetFunctionArgs();" returns 6 arguments (only 4 actually ). I mean CSCS goes some problem when parsing direct array arguments. of course,U can define "a={100,0};b={200,0}; UseFunction("Info",a,b,23.3)" instead, and it can work correctly. Could this little bug be fixed ? Many Thanks, |
Hi there, fixed with the latest check in! |
Dear Dev,
I have to say i love this code, best ever im glad to use it in my projects, however what im missing is examples how exactly use all of commands. It would be enought just make sample for each command. And how to integrate own commands..
Thx
The text was updated successfully, but these errors were encountered: