|
Post by cuchilo on May 16, 2023 16:38:22 GMT
When I start up JB I go to run (ENTER ) a smaller screen appears with a flashing cursor, when I start to type the cursor freezes, HELP please
|
|
|
Post by plus on May 16, 2023 18:43:47 GMT
Really would help if you guys show the code you are attempting instead leaving your potential helpers guessing. You would only need to press Enter after you have an Input line like this: print "Hello" input "Please enter your name ";name$ print "Hi ";name$
PS if you don't have any Input line the screen normally flashes at the next print line until you close it. WELCOME TO JUST BASIC FORUM
|
|
|
Post by cuchilo on May 17, 2023 13:33:56 GMT
Cheers for that, seems to be working now. When I did my programming in the 90's Basic had line numbers in increments of 10's, is there any way I can get this on JB ?
|
|
|
Post by plus on May 17, 2023 13:50:34 GMT
Yeah but why?
Line numbers are really just considered line labels, you are nameing your line with a number they don't have to be in sequence (that was for old, old, old) line editors like GW Basic where line numbers told the editor where the line goes.
see here this works just fine!
300 print "Hello" 200 input "Please enter your name ";name$ 100 print "Hi ";name$
|
|
|
Post by Rod on May 17, 2023 14:07:26 GMT
yeah, don't use line numbers. Learn to use [label] and code blocks. Gosub 100 is exactly the same as saying gosub [onehundred] and the great thing is you don't need to type in all those in between numbers
|
|
|
Post by tsh73 on May 17, 2023 14:18:32 GMT
Yes, but
gosub [killMonster] beats it with showing clear intent, and
call killMonster beats it with having local variables
|
|
|
Post by plus on May 17, 2023 16:12:41 GMT
Well not exactly if you have GoSub 100 ' needs a 100 label and goSub [onehundred] ' needs a [onehundred] label
Otherwise Just Basic will be scratching it's head asking when did I learn to read or know 100 means [onehundred]?
Line labels are better because they can help document your code with short descriptions if you are smart with labeling.
|
|
|
Post by Rod on May 17, 2023 18:36:28 GMT
Killmonster is great [100] less so?
|
|
|
Post by plus on May 18, 2023 18:13:12 GMT
Killmonster is great [100] less so? What ? Must be a Scottish thing Maybe a GoSub [Killmonster] ? Would be great to have such a routine.
|
|
|
Post by Rod on May 18, 2023 18:32:33 GMT
The point is you can’t have [100] but you can have [onehundred]
|
|
|
Post by tsh73 on May 18, 2023 19:44:25 GMT
I just checked I can have [100] , and this label even works But label without a meaning like a -- "A samurai without a sword is like a samurai with a sword. Without a sword." ;)
|
|
|
Post by Rod on May 19, 2023 6:18:47 GMT
Ah.. but meaningful, or informative branching labels are certainly the way to go.
|
|
|
Post by marshawn on May 19, 2023 10:02:14 GMT
what would you say is more meaningful and informative:
gosub [ten] gosub [eleven] gosub [twelve] gosub [thirteen] gosub [fourteen] gosub [fifteen] gosub [sixteen] gosub [seventeen]
or something like
for i=10 to 17 gosub i next
|
|
|
Post by Rod on May 19, 2023 10:43:25 GMT
Descriptive, not a label for a labels sake.
gosub [openthefile] gosub [importdata] gosub [createwindow] gosub [gamecycle] gosub [changedirection] gosub [updatescore]
|
|