It is currently Sat Apr 29, 2017 10:34 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Label regression in 1.91
Unread postPosted: Thu Mar 16, 2017 3:19 am 
Offline

Joined: Tue Dec 02, 2014 12:14 pm
Posts: 28
In v.1.91 label
Code:
repeat2:

gives error:
Code:
REPEAT without WHILE

In v.1.90 this label was valid.


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Sat Mar 18, 2017 11:42 am 
Offline
User avatar

Joined: Tue Nov 04, 2014 7:12 am
Posts: 122
Hello!

For my "lagging" every few seconds for a moment. (1.91) :roll: :(

_________________
"Unfortunately I only BASIC to understand. Everything else I need strong help..." :P


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Tue Mar 28, 2017 11:24 pm 
Offline

Joined: Tue Dec 02, 2014 12:14 pm
Posts: 28
bk99 wrote:
In v.1.91 label
Code:
repeat2:

gives error:
Code:
REPEAT without WHILE

In v.1.90 this label was valid.

Is it bug or feature?


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Wed Mar 29, 2017 7:33 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
The answer I think you will find is in the release notes bk99:-

version-v01-91-released-t4969.html

Quote:
• Label lines are not cached unless they are executed. Early caching by the preprocessor masked syntax errors. Fixed in v01.89, but broken again in v01.90.


Mog


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Wed Mar 29, 2017 10:00 pm 
Offline

Joined: Tue Dec 02, 2014 12:14 pm
Posts: 28
Mog wrote:
The answer I think you will find ...
Mog

But (as I understand) it is not correct - to perceive string "repeat2:" (label, with colon at the end) as "repeat" (fragment of cycle), is it?


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Wed Mar 29, 2017 11:56 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5487
Location: Paris, France
The BASIC! interpreter discards all spaces between words.
"repeat2:" (no space) is the same as "repeat 2:"

"repeat" is a reserved keyword.
You cannot name your labels by starting them with a keyword, this is in the manual.
So a label called "repeat2:" should throw a syntax error according to the manual.
The fact that it didn't in previous versions of BASIC! was actually a bug, but the manual instruction was clear all along:
De Re BASIC! wrote:
a label must not start with a BASIC! command keyword


In case of doublt, always follow the manual ;)

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Thu Mar 30, 2017 12:50 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
Just to add as well...

Code:
GOTO repeat2:

repeat2:
END "Hello and Goodbye..."


Works though.

Where is some example in your code where this fails please?

What I understand about the pre-processor is:-

• Everything gets converted to lower-case
• All spacing gets removed
• A colon ':' effectively creates a new line.

Okay, there's a colon in a label, but this also works:-

Code:
GOSUB repeat1:PRINT"I'm Back! What a boring subroutine that was!"
END

repeat1:
PRINT "Cooo eee! I'm in the GOSUB I'll just sit here for 3 seconds.."
PAUSE 3000
RETURN


And best practices; You shouldn't use commands as pre-fixes in your code. I got caught out when the DEVICE command came out with an assignment. It broke old code. No big deal.

Code:
deviceWidth = 1024
PRINT deviceWidth


Returns 0.0

Code:
LET deviceWidth = 1024
PRINT deviceWidth


Returns 1024.0

I don't think this answers your question, I don't know what techniques BASIC! uses. I think "some sort of look up table thingy thing" I find Java very complex and outside my scope along with computer science in general!

From my understanding from Marc's statement is that BASIC! uses some sort of memoisation technique. [If I got that right I'd be shocked, because i only thought there was only 2 types of ways to cache. There are many on the hardware and software side]


:)

Mog


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Fri Mar 31, 2017 10:01 pm 
Offline

Joined: Tue Dec 02, 2014 12:14 pm
Posts: 28
Mog wrote:
Code:
GOTO repeat2:

repeat2:
END "Hello and Goodbye..."

Works though.

Where is some example in your code where this fails please?


This code gives "REPEAT without WHILE" error:
Code:
repeat2:
END "Hello and Goodbye..."

GOTO repeat2


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Sat Apr 01, 2017 12:42 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
D'oh! I put an extra colon on the GOTO!

Should have been:-

Code:
GOTO repeat2

repeat2:
END "Hello and Goodbye..."


Mog


Report this post
Top
 Profile  
 
 Post subject: Re: Announcement about 1.91
Unread postPosted: Sat Apr 01, 2017 1:06 am 
Offline

Joined: Tue Dec 02, 2014 12:14 pm
Posts: 28
Mog wrote:
D'oh! I put an extra colon on the GOTO!

Yes. But it doesn't matter. The problem is that your code work and my (from my previous post) - doesn't.


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 10 guests


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 post attachments in this forum

Search for:
Jump to:  
suspicion-preferred