multiple statements per line/long-line statements/editor layout

閲覧: 50 回
最初の未読メッセージにスキップ

Stuart Gillies

未読、
2021/02/16 7:24:342021/02/16
To: Annex WiFi RDS
I'm confused. The Help thing states that multiple statements can be put on the same line. Practice suggests that it doesn't work, odd things happen with no error message (e.g. this subroutine fails: "Daylight:current_mode$="Daylight":gosub paint:return". I realise that it isn't easy to read but I use this format simply to save paper when printing a listing.

Secondly, when e.g. initialising an array it can be necessary to have a long line of values in the DIM statement. Most forms of Basic use the line continuation character (_). But it doesn't seem to work here.

Finally, on a separate matter, is it possible to lock the editor layout so that when I have made it the way I want, using most space for the fields that I use most, it stays that way?  


cicciocb

未読、
2021/02/16 10:35:322021/02/16
To: Annex WiFi RDS
Hi Stuart,
the multiple statements on a single line are not fully supported, in particular does not work when there is a gosub in the line.
I do not support into writing programs with multiple commands per line as this easily generates understandable programs.
So I can only suggest to always write a single command per line, even if this generates longer programs to print.
The line continuation is not supported as well because it would unnecessarily complicate the interpreter

About the editor layout, yes, I already planned to implement something in the future

Dwight

未読、
2021/02/16 10:44:052021/02/16
To: Annex WiFi RDS
Hi Stuart,
I would suggest you at least include spaces before and after each statement in your code.

 "Daylight:current_mode$="Daylight":gosub paint:return"

Daylight:
current_mode$ = "Daylight" : gosub paint : return

something like that.
I am not sure how much memory you are saving by trying to keep everything on one line but I suspect it is minimal as you really are exchanging a NEW LINE for a COLON

Is there a reason you don't want to go the "traditional" route of using separate lines?

at any rate try with the spaces.
Likely Cicciocb will weigh in on this

cheers
Dwight

Stuart Gillies

未読、
2021/02/16 12:54:222021/02/16
To: Annex WiFi RDS
Thanks, that is helpful. Perhaps the help file could be updated? Or a list of exceptions be maintained as a gotcha, as there are a few departures from the help details and I got led down a rat hole before I realised.

As I mentioned, I'm doing multi-statement lines to save paper on frequent printouts. Normally I would use lots of comments, white space, and underlines, but as they remain in the code they use up space. Prior to Annex, my experience was with Picaxe, where code is pre-processed before loading into the interpreter, so comments could be stripped and pretty layout for clarity had no cost. But downloading wasn't OTA so this is much better overall!
全員に返信
投稿者に返信
転送
新着メール 0 件