FAQ  •  Register  •  Login

Suggestion for the Syntax section

<<

programandala.net

Posts: 98

Joined: Fri Apr 09, 2010 12:50 am

Location: España/Hispanujo/Spain

Post Sun Jun 20, 2010 4:13 pm

Re: Suggestion for the Syntax section

boriel wrote:use
  Code:
<zxbasic>...
listing
...</zxbasic>

This way you avoid blank lines at top and bottom in the listings.


Thanks. I think I did so. Maybe I mistyped somewhere. I did left blank lines bewteen titles and listings or paragraphs, just to make wiki markup easier to read and edit.
<<

programandala.net

Posts: 98

Joined: Fri Apr 09, 2010 12:50 am

Location: España/Hispanujo/Spain

Post Sun Jun 20, 2010 4:15 pm

Re: Suggestion for the Syntax section

boriel wrote:I've already <zxbasic'ed> the examples and games listings.


I've finished the Library page, the libraries and the trigonometrical functions.
<<

programandala.net

Posts: 98

Joined: Fri Apr 09, 2010 12:50 am

Location: España/Hispanujo/Spain

Post Sun Jun 20, 2010 5:46 pm

Re: Suggestion for the Syntax section

boriel wrote:This way you avoid blank lines at top and bottom in the listings.


I've just realized what you meant. First I thought you meant I was leaving a blank line between <zxbasic> and the listing. But what I'm doing is typing <zxbasic> and </zxbasic> on their own lines, because in my opinion that way the wiki source is a bit easier to read and edit. And that effectively renders an empty line! I didn't realized before.

That extra border doesn't look bad for me. Anyway the best solution would be to fix it in the extension, make it not to render that lines at the start and at the end of the block. Or maybe it could be done with CSS.only. That way the layout of the wiki source wouldn't change the final HTML.

But I can write <zxbasic> and </zxbasic> next to the code lines, no problem.
<<

boriel

Site Admin

Posts: 1521

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sun Jun 20, 2010 8:32 pm

Re: Suggestion for the Syntax section

I really don't mind very much, anyway. And thanks a lot :roll:
<<

zarsoft

Posts: 1

Joined: Wed Jan 08, 2014 12:08 am

Post Wed Jan 08, 2014 12:11 am

Re: Suggestion for the Syntax section

I think code without line numbers should be respected



  Code:
   5 :
   7 REM ZX Spectrum BASIC without line numbers
   8 REM written by Zarsoft
   9 :
  10 REM init subrotines
  15 LET factorial=100:
  19 :
  20 REM ----------------------
  21 REM    test factorial
  22 REM ----------------------
  30 PRINT "max= ";:
   INPUT max:
   PRINT :
   FOR n=1 TO max:
   GO SUB factorial:
   PRINT "fact(";n;")= ";result:
   NEXT n:
   STOP :
   GO TO 10000
  95 :
 100 REM ----------------------
 101 REM     factorial
 102 REM ----------------------
 110 LET result=n:
   FOR f=n-1 TO 2 STEP -1:
   LET result=result*f:
   NEXT f:
   RETURN
 999 :
<<

boriel

Site Admin

Posts: 1521

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Oct 30, 2018 10:49 am

Re: Suggestion for the Syntax section

Sorry, I overlooked this message.
The code above is respected, but the variable "factorial" is a variable and ZX Basic (as many basics) don't resolve line numbers dynamicaly. Also there's is a missing line 10000. You should add an empty line
  Code:
10000 REM

for the program to compile, and perhaps use ON GOTO to transform factorial variable into a jump table.
Previous

Return to Documentation

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO