Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Strange things in Bascom concept - what to improve

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
JP2

Bascom Member



Joined: 17 Apr 2007
Posts: 23

blank.gif
PostPosted: Tue Apr 17, 2007 10:23 pm    Post subject: Strange things in Bascom concept - what to improve Reply with quote

Hi,

Error handling
Why doesn´s Bascom jump to the line with the error after finding one? Getting the line number from the report window and then scrolling to the line manual is just wasted time.

Bascom does not seem to check as much syntax as a beginner may need. Sometimes, syntax errors cause VERY strange errors at a totally different lines.
Example: "Config SDA = PINC.4" - that gives you real fun. At the first look, the code looks good as SDA needs a Pin, but Bascom expects a Port. The compiler gives a lot of errors but no one points at the line of error.

Second example. If you forget to close a conditional branch like if-else-end if or select case- end select and you forget to close it by "end if / end select" that causes a lot of errors but again no one points to the real problem.

Code hints
Why are there commands without code hints? Some commands have code hints (If, Select case), but a lot of commands do not have hints like SHIFT, Left, Right etc.
I cannot see any reason for this.
What about code hints on self definied subs und functions?

Code reformating
I am very sorry, but the code reformating concept sucks, totally.
Words you want to have reformated to self definied case like self definied consts, vars, Subs or functions are destroyed by reformating. There is a reason, why I write it like MyFunctionIsCool() or CONST THIS_IS_COOL. Bringing all words to first letter uCase is nonsence. You know the VB5/6 IDE? Why not take this reformating? It is perfect.

LOCAL Var initialisation?
Like I found out after some strange errors, Bascom does not initalize local defined vars. If you use a String*10 as a local ring buffer, it is still filled with last time data upon the next call of the sub / function.

Passing a String ByVal fails without Error
Code:
Declare Sub Test(ByVal s() as String)

dim x as string * 10
x = "Hallo"
call test(x)
end

Sub Test(ByVal s() as String)
   Print s
End sub


What will be printed? Nothing. What do I expect? "Hello" or a compiler error. I cannot pass a string ByVal and this is undocumented. This drove me nuts until i figured it out myself.

I am sorry for all this critic. I am new to Basom, but I have the full version. These are the problems I found during my first project and I BET I am not the only one with this points.

Anyway, keep on going...great fun with AVRs.

JP
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Tue Apr 17, 2007 10:54 pm    Post subject: Reply with quote

Hi,

Error handling

Double click on the error text to jump to the line causing the error.

* * *

LOCAL Var initialisation
(Bascom does not initalize local defined vars).

Most of the time, it would be a waste of CPU time.
In your case use:
Code:
Local s as string * 10
s=""


* * *

Passing a String ByVal

Use that:
Code:
$regfile = "m16def.dat"
$crystal = 4000000
$baud = 9600

$hwstack = 32
$swstack = 16
$framesize = 40

Declare Sub Test(Byval z as String)

dim x as string * 10
x = "Hallo"
call test(x)

Print x
Print Len(x)

End

Sub Test(Byval z as String)
   Print z ; " Herr Professor!"
   z = "abc"  
   ' Note that the maximal length of the variable z is 10 bytes.
   ' 10 bytes (11) of frame space are used for z, same size as variable x.
   Print z
   Print Len(z)
End sub
'-------


Best regards,

Luciano
Back to top
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1548
Location: Basel, Switzerland

switzerland.gif
PostPosted: Wed Apr 18, 2007 11:58 am    Post subject: Reply with quote

Hi,

Have you ever used another IDE apart from Visual Basic? Although Bascom isn't the best, it isn't the worst I've seen/had to use.

On one system I've worked on the IDE was so bad I ended up using notepad to edit files as I wasn't allowed to use or install anything else.

bascom does have it's problems btu for the price you can't complain. I quite often use UltraEdit for text editing and that cost me more than Bascom even though it's "only" a programmers text editor.

Regards
Ian Dobson

_________________
Home of AVRTimer, the Bascom timer value calculator.
http://www.planet-ian.com

Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile Visit poster's website
JP2

Bascom Member



Joined: 17 Apr 2007
Posts: 23

blank.gif
PostPosted: Wed Apr 18, 2007 1:38 pm    Post subject: Reply with quote

i.dobson wrote:
Although Bascom isn't the best, it isn't the worst I've seen/had to use.


I am sorry, but compared to the the compiler stuff, the IDE is NO rocket science at all. It is great, what you get for 79,- EUR but with a small amount of work you can really make it better.

From the view of a software developer, I cannot see the problem doing a ProperCase reformat. You just have to run a list of typed words in the background and if a word is already in the list, format it like it is formated upon first apperance. It it is not in the list, add it to the list.

Same thing with the code hints. The function is there, but it has not been added for all commands. Why?

You see, if I would like it the hard way, I would use ASM or C. But I have decided to have it the easy way. Thats why I bought Bascom. I want easy using Basic and I would like to have it as comfortable as possible. SO what is wrong about telling my ideas of improvement?

This code reformating thing has been discussed in the forum last summer. I found an old thread where Mark tells about a "new IDE product".
http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=2437&highlight=reformat

JP
Back to top
View user's profile
lpa

Bascom Member



Joined: 12 Dec 2006
Posts: 27
Location: Oreokastro, Greece

greece.gif
PostPosted: Wed Apr 18, 2007 2:31 pm    Post subject: Reply with quote

JP2 wrote:

SO what is wrong about telling my ideas of improvement?

JP


Hello JP,

there is nothing wrong with your proposals, but Mark does not monitor this forum.

It is better to address your proposals directly to him through email.

I personally think that your suggestions are valid.
Back to top
View user's profile Visit poster's website
Darxon69

Bascom Member



Joined: 24 Oct 2006
Posts: 3

germany.gif
PostPosted: Wed Nov 14, 2007 11:19 am    Post subject: Improvement idea Reply with quote

I have another idea for Bascom IDE improvement. I often split my large projects into several smaller files. Then I use one Main-file and link the other files with $inlcude statement.
The problem is that editing in bascom is really bothersome when many files are open because if you click on one code window the other windows are goin into the background and it is not easy to find them again when you need to edit them. The better way is using tabs like in other IDEs.
So you easy find your code window by clicking on the tab at the Top of the main window.
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum