_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

you do realize? Personal choice, do what you want, and the compiled code is the same, but one is easier to read IMHO.

in a couple of places, you are comparing strings ( == ), another place you concatenate them (string + string). Some languages allow that, ANSI C does not (unless its changed that I do not know of), RobotC is somewhere in the middle so it may have worked and no longer does, or it may be an unintentional bug. My tendency is use strncmp and strncat.

As I said, I was working on updating it. I've learned a lot of things since April. That thing with the braces being one of them.

Spiked3 wrote:

In a couple of places, you are comparing strings ( == ), another place you concatenate them (string + string). Some languages allow that, ANSI C does not (unless its changed that I do not know of), RobotC is somewhere in the middle so it may have worked and no longer does, or it may be an unintentional bug. My tendency is use strncmp and strncat.

It did support them when I originally wrote it. Apparently not anymore.

It seems to me as if some of the errors have to do with internal stuff?

Here's a screen cap so the line numbers can be seen.

Attachments:

File comment: Errors.Errors.jpg [ 297.21 KiB | Viewed 4700 times ]

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Fri Sep 21, 2012 10:55 pm

tfriez

Site Admin

Joined: Wed Jan 24, 2007 10:42 amPosts: 620

Re: RobotC 3.51 errors

It's difficult when trying to do inline comparisons of strings (I.e someVar == "abc) with the new support for character arrays. A fixed string comparison should not rely on the double equal sign as this does not promote comparing between strings and character arrays. ANSI-C does not support this and the previous ROBOTC implementation was a kludge... So we fixed it so its more in line with what a C compiler should do... Apparently we can't please everyone even though you guys get on us for not being "C compliant"

To permanently solve the issue, you should change the logic to if(strcmp(someVar,"abc") == 0) - its more in line with how it should be taught rather than relying on language extensions to implicitly do the same thing.

I agree. You should learn the standard way. The problem with non-standard features is that beginners would learn this all wrong and got a surprise when they switch to standard C in the real world. In general, using non-standard features also makes your program not portable to other platforms.

Okay. I will forget all my previous string work. I don't even want to know how much of my old code is broken by now.....

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Sat Sep 22, 2012 11:07 am

tfriez

Site Admin

Joined: Wed Jan 24, 2007 10:42 amPosts: 620

Re: RobotC 3.51 errors

NeXT-Generation wrote:

Okay. I will forget all my previous string work. I don't even want to know how much of my old code is broken by now.....

I understand the frustration with the new version of ROBOTC - Because of the newly re-written compiler, there may be things that we were working previously but were not necessarily the correct methodology - but we feel that the new functionality will assist users with learning with a proper C-programming while still having an easy to use experience. Our goal is to make ROBOTC as easy to use with absolute beginners while still providing all of the tools for advanced programmers to feel comfortable.

If you're having issues converting your code with all of the new functionality, please contact us at support@robotc.net and attach your programs and we'll be happy to assist with any issues you're having.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum