Posts: 156
Threads: 14
Likes Received:
46 in 37 posts
Likes Given: 46
Joined: Oct 2023
Reputation:
3
What can a person do when they have a small basic program that they want to convert to c# and the conversion comes up with a bunch of error messages that you don't understand that originates from visual studio. The program runs fine in small basic. The problems occur after conversion. This is an issue with visual studio. It generally gives potential fixes that never work and the explanation of what is wrong is way beyond my comprehension.
Most of the time I end up just leaving the running program in small basic and give up on converting to c#. I know that is not the ideal way of doing it, but what else can a person do?
JR
Posts: 464
Threads: 37
Likes Received:
374 in 256 posts
Likes Given: 183
Joined: Aug 2023
Reputation:
17
I guess they can share a SB program here that fails to convert, and ask for help.
Or they can google the error messages in VS and see what they can learn.
It's a process of learning we all take, the key is to gradually increase understanding, not just get the fix, so writing small programs directly in C# is a good idea. Those converted from SB are not optimal C#.
I'm currently learning Kotlin and Filament for 3D android development and node.js with Typescript for browser development, and it's tricky with mixed quality web resources.
Posts: 156
Threads: 14
Likes Received:
46 in 37 posts
Likes Given: 46
Joined: Oct 2023
Reputation:
3
LitDev,
I'm trying to do 1 sb program. If I use ILSpy I get 1 set of errors from visual studio. If I use DnSpy I get a different set of errors from visual studio. None of the possible fixes from visual studio work. What visual studio says is wrong doesn't make sense to me for either way it was decompiled. At least in small basic you normally understand what the problem is. Not so in visual studio!
JR
Posts: 331
Threads: 37
Likes Received:
121 in 95 posts
Likes Given: 223
Joined: Dec 2023
Reputation:
7
Hi litdev
I was also learning new skills I can't get vs so I got vscode in which I could try amazing languages.
After knowing that c# would only work on pc with .net I started looking for cross platform.net framework.
Came across mono(current dead),.net maui which could be used on my .net 8 but it's work load is huge size,same problem of huge workload for other than .net like Flutter(Dart),React(JS).
Now I will try to learn a new good cross platform language like c,cpp,rust.
Any good advice please
ZS
Posts: 464
Threads: 37
Likes Received:
374 in 256 posts
Likes Given: 183
Joined: Aug 2023
Reputation:
17
@JR,
If you publish the SB program code I will have a look, or even zip up the VS project you have, but without these any advice will be very generic. Error messages can be confusing, but once you understand them they usually make sense - googling is your friend here. I suggest trying the Advanced->Decompile option in SB-Prime as well, it does a couple other bits to the project setup.
@ZS,
Anything you learn will be useful, but probably the most generic cross-platform would be C++ (toughest) or maybe Python (easier and loads of libraries, especially for data science type stuff), but it really depends what you want it to do, which existing libraries you want to use etc. If you want Windows Desktop then I would go SharpDevelop C#. Maui .Net 8 is very heavy and not so easy as C#, its C++ and the GUI designer is poor, but it is cross platform, probably only for larger proffesional type projects that want to run on Windows and Linux. Android or IOS have their own languages, web frontend (javascript), backend (php) are different again.
Posts: 156
Threads: 14
Likes Received:
46 in 37 posts
Likes Given: 46
Joined: Oct 2023
Reputation:
3
12-09-2024, 07:41 PM
(This post was last modified: 12-09-2024, 07:43 PM by jrmrhrb00.)
LitDev,
Here's the program: WBVB625.000
Here's the error I get with visual studio:
Cannot implicitly convert type 'Microsoft.SmallBasic.Library.Primitive' to 'Microsoft.SmallBasic.Library.SmallBasicCallback'
This means nothing to me! other than it's trying to convert a primitive into something else. Gives me no clue as to what to do. The fix suggestions don't work.
JR
Posts: 156
Threads: 14
Likes Received:
46 in 37 posts
Likes Given: 46
Joined: Oct 2023
Reputation:
3
LitDev,
Got it!
Thanks for the help! I still think Visual Studio's verbiage is lacking clarity.
JR
Posts: 156
Threads: 14
Likes Received:
46 in 37 posts
Likes Given: 46
Joined: Oct 2023
Reputation:
3
So, what is the big deal about converting a program to c# or for that matter visual basic. It will probably run faster and for the joy of learning another programming language. If you think about it though, you have a programming language that is easy to use and has wonderful extensions. What else do you need?
LitDev has created the LitDev extension and Prime. These features have actually propelled Small Basic into being a featured programming language. And even with all of that it is still easy to use. Thanks to LitDev for all of his wonderful work and for supporting his web site.
JR