We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SB-Prime variable intellisense
#21
How do you recognize that a variable has been written?

Its a word + a non word character, if this character is a . then it wrongly adds an object as a variable.  I uploaded a fix for this.

Your image shows a new var for each character - that's not what I have when I just type the words.

   
Reply
#22
I have checked it with the new option "Parse variable ..." and also just typed the name testversion.
And "Textwindow" has a variable icon.

Edit:
I have updated SB-Prime and the Entry "Textwindow" appears correct.
But with this option an entry is still created after every character entered.
Maybe that's how it's supposed to be with this option. Otherwise the mouse position and operators would have to be evaluated!?
Reply
#23
Yes, that was what I meant by " if this character is a . then it wrongly adds an object as a variable.  I uploaded a fix for this."

Sorry I tend to modify a post when I discover something new revelant to that post.

EDIT

I don't get that if I understand correctly - see my image in post 21 (just tested with /l:de-de and still doesn't create variables for each character typed). 

I can't see how this could happen unless you type a space after each character and then delete the space for example, or if there is something in the way your keyboard works that causes a similar effect.

EDIT2

I was able to reproduce Scout's issue by putting a space in a line, then moving cursor to before the space and type a word.  Every time a letter is typed it sees the word+space and thinks this is a finished word.
This would clearly happen a lot typing into an existing line before a space for example.
Can't win them all, I guess it all depends on how folk use it, but I think the big win is we understand the rules and there are a couple options (Options Parse variables as they are typed and Format that also rechecks all variables).
Thanks to Scout and AB for working to improve this. Smile

EDIT3

Uploaded a version where it checks for variable assignment before adding to list of variables when parsing current line.  That is, there must be a = following the variable (optionally after white space).  Variables only need to be found once to be added and when a new variable is added by user it almost always is initially set to a value. Big Grin
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply
#24
(translated by Google translator)
Hi all.
I don't know if I have chosen the right topic for my this post.
Maybe I don’t know again that SB-Prime already has a function for collapsing a block of arbitrary code.
But, if there is no such function, then here is a life hack that came into my head this morning.
Code:
code_block = "True"

If code_block Then
  ' some code
  ' line 1
  '...
  ' line N
EndIf
I don't know about you, but for me it's not bad at all.  Tongue
[-] The following 2 users Like AbsoluteBeginner's post:
  • litdev, z-s
Reply
#25
It Was Already Know I Don't Remember but it was in some LD extension examples.
ZS
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)