Error converting with Duocode using Winforms

Asked

Viewed 67 times

1

I developed a C# application using Windows Forms, but wanted to convert to Javascript using Duocode. But it is giving the following errors:

tryduocode.cs(7,14,7,21): error CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

tryduocode.cs(32,18,32,29): error CS1061: 'Form1' does not contain a definition for 'btnTraduzir' and no extension method 'btnTraduzir' accepting a first argument of type 'Form1' could be found (are you missing a using directive or an assembly reference?)

Maybe I should use Console instead of Windows Forms.

1 answer

1


Forget it, the Duocode does a lot of things, but it doesn’t work miracles. It can only convert trivial applications that operations in memory and little else. Surprisingly he can even convert something simple that makes IO (in and out) but very little. Can’t take an application using Windows Forms and try to convert to run in a browser.

I don’t know if switching to console will help you. If you can keep adjusting your application this way, then you don’t need this converter.

It was made to convert a few things, in general validation functions and some data manipulation operations. Not made to convert entire applications.

There must be a good reason to use it. It is not a magic wand that solves all problems.

  • Yeah, you’re right. I made some modifications. I took out all the Windows Forms reference. I switched the Textbox to public variables. I was able to do the conversion. It was really to have an idea of how to write the same code in Java. It’s just a program that reads a sentence and sends it to a character-by-character function and tells the meaning of each letter. Thank you very much.

  • 1

    The conversion is not made for the code to be readable in JS, it is only to work there. Do not time it as a basis. Each language has its particularity and you must program in it in its own way.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.