I write code in both Swordfish BASIC and a variety of C compilers for the PIC. I find I'm always having problems where Swordfish isn't working but the error isn't obvious. You can tell there is an error as the code explorer window stops showing all the subs, but it can take ages to spot the error.
The problem is always my error - I have used C terminology rather that what Swordfish uses.
The most common ones are the use for & in place of And and the use of 0x for hex numbers rather than $.
How difficult would it be for Swordfish to accept both options? I'm sure there are others - Or and Not come to mind for example.
Also, it would be useful if there was some way in the IDE for it to highlight the point at which it 'gives up' so it is easier to track down the error.
Suggestions to make it easier to move between languages
Moderators: David Barker, Jerry Messina
-
- Posts: 113
- Joined: Mon Jan 11, 2010 10:39 pm
- Location: Chesterfield
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
> How difficult would it be for Swordfish to accept both options?
> I'm sure there are others - Or and Not come to mind for example.
I understand what you are saying but I think such a change would not benefit Swordfish in general.
> Also, it would be useful if there was some way in the IDE for it to
> highlight the point at which it 'gives up' so it is easier to track down
> the error.
It does this already, it tells you the point it failed. If you give me an example of some code and resulting error that doesn't do this, I would be more than happy to take a look for you.
> I'm sure there are others - Or and Not come to mind for example.
I understand what you are saying but I think such a change would not benefit Swordfish in general.
> Also, it would be useful if there was some way in the IDE for it to
> highlight the point at which it 'gives up' so it is easier to track down
> the error.
It does this already, it tells you the point it failed. If you give me an example of some code and resulting error that doesn't do this, I would be more than happy to take a look for you.
-
- Posts: 113
- Joined: Mon Jan 11, 2010 10:39 pm
- Location: Chesterfield
Fair enough - I'd say if any other users comment on the thread that would give a more representative feeling. To me, allowing all 'common' ways of doing basic things opens the language and avoids putting people off from having to learn the peculiarities of a new syntax. However, I'm not the one writing the compiler and there may be good reasons for not doing it unless a lot of users feel it would be beneficial.David Barker wrote: I understand what you are saying but I think such a change would not benefit Swordfish in general.
I think I've explained myself badly. The compiler does highlight errors, it is the preprocessing in the IDE that I'm talking about. It stops automatically adding functions, subs, variables etc to the code explorer when it encounters something unexpected, but doesn't seem to highlight the actual item which is confusing it. I've now learned that you can work out the sub where the error is based on what is added to the code explorer, but if you are writing a large sub or function is can take a while to identify the actual error.David Barker wrote: It does this already, it tells you the point it failed. If you give me an example of some code and resulting error that doesn't do this, I would be more than happy to take a look for you.
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
I'll butt in. I'd love it if Swordfish accepted my C syntax too (which like you I do more often than not), but unfortunately I probably have to agree with David on this one.Fair enough - I'd say if any other users comment on the thread that would give a more representative feeling
Swordfish is already different enough from what most folks think of as BASIC that extending it too much more would likely confuse things. From what I've seen I think people who've used different languages seem to appreciate SF, while beginners have a hard time getting their head wrapped around it.
Of course, actually READING the manual would help a lot.
When things don't compile, scroll down to the bottom of the error window to the "last one" (which is actually the first error) and click on it. Work on resolving that one and many times a lot of others disappear. Sometimes it can be tricky as the real error is in a previous line, but it usually gets me in the neighborhood.I've now learned that you can work out the sub where the error is based on what is added to the code explorer, but if you are writing a large sub or function is can take a while to identify the actual error