You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


which commands are the most important?
08-22-2017, 08:46 PM
Post: #1
 (Print Post)
which commands are the most important?
ive played with qb64 source before-- a few of us have, i know walt has done more than i have with the source.

if someone was making a stripped-down qb64 or other basic, which commands would be the most useful to add?

of course no one has to agree (and therefore no one has to argue) they could just list the ones they think are most important.

the return question "important for what?" is valid. the answer: important for a smaller, localised version of qb or other basic. if qb64 had about 200-250 keywords, and not more-- for the purpose of teaching a first programming language based not in english.

or in simpler terms: "important for people just learning to code." as to whether a language with fewer keywords is the way to do that, obviously a lot of people dont think so anymore (just look at how giant languages have gotten.) but thats a given in this thread-- if you dont answer that part, you are answering a different question.
Find all posts by this user
Like Post
08-22-2017, 11:44 PM
Post: #2
 (Print Post)
RE: which commands are the most important?
by the way, i got this reply from michael, here: http://www.network54.com/Forum/648955/me...vised+list


in the language:

common keywords with various meanings:
END (ends various blocks)
() parenthesis (function parameters, array subscripts, and expression evaluation)
TO
AS
NEXT
STEP
maybe others

variables, arrays, structs, constants:
AS
STRING, INTEGER, LONG, SINGLE, DOUBLE.
DIM, REDIM
TYPE
. (dot, for member access of structs)
SHARED should be used with discretion
CONST
STATIC maybe for intermediates.
DATA, RESTORE, READ should not be used by beginners.

Arithmetic and logic:
= assignment
() parenthesis
+, -, /, *, \, MOD, AND, OR, NOT, XOR
<,>,<=,>=,<>,= comparison
The bitwise operations, and the concept of non-zero true and zero false might be intermediate, but programmers should make a point of learning them.

conditionals:
IF THEN ELSE ELSEIF
SELECT CASE

loops:
DO, LOOP, WHILE UNTIL
WHILE, WEND are nice, but redundant with DO WHILE.
FOR, TO, STEP, NEXT

functions:
FUNCTION, SUB
GOSUB, RETURN can be used with discretion

break from block:
EXIT
GOTO should be generally discouraged

reinterpret typecasts:
ASC, CVI, CVL, CVS and/or CVD
CHR$, MKI$, MKL$, MKS$ and/or MKD$
of these ASC and CHR$ are useful for beginners, the I and L ones intermediate, the S and D ones a little more advanced in implementation, though maybe intermediate in usage.

conversion typecasts:
FIX, INT, CINT, CLNG, CSNG and/or CDBL
of these, INT is the most useful for beginners

pointers:
VARSEG, VARPTR
DEF SEG, PEEK, POKE
more for intermediate to advanced. intermediate can use to access keyboard status and VGA buffer.

other language routines:
CALL ABSOLUTE, BYVAL are advanced

in the standard library:

program termination:
SYSTEM

math:
SIN, COS, TAN, ATN are intermediate in application, advanced in implementation, in my opinion. (I know how to use them, but I do not know how they work.)
^ (exponent), SQR
ABS, SGN
EXP, LOG are advanced, in my opinion. (I do not know how they work.)
RND is beginner in application.
RANDOMIZE

string manipulation:
+ (string cat)
LEN
MID$, LEFT$, RIGHT$
UCASE$, LCASE$
INSTR
STRING$, SPACE$

string conversion:
VAL, &h
HEX$
STR$
hexadecimal can be considered intermediate, but programmers should make a point of learning it

text display:
PRINT
LOCATE
COLOR
WIDTH, VIEW PRINT (to not scroll from 24th line)
CLS
SCREEN is nice, but less necessary

keyboard input:
INKEY$
LINE INPUT
INPUT

graphics:
SCREEN
PSET
LINE B BF
CIRCLE
GET, PUT maybe intermediate
PALETTE
POINT

sound:
PLAY
SOUND
BEEP

File I/O:
OPEN FOR INPUT OUTPUT APPEND BINARY AS
CLOSE
FREEFILE
GET, PUT maybe intermediate
LOF, EOF maybe intermediate
ACCESS READ should be encouraged when appropriate

joystick:
STICK, STRIG

clock:
TIMER
DATE$, TIME$

debugging:
STOP

environment:
SHELL
ENVIRON$ and COMMAND$ are intermediate

trapping:
ON ERROR GOTO, ERR, ERL, RESUME NEXT is a bad way of doing things, but sometimes necessary in QBASIC
specifically, can be used to detect whether a file exists. In the old days, could detect graphics card type.
ON PLAY a bad way of doing things, but sometimes necessary to sync music in QBASIC.

QB64:
_UNSIGNED
_PRESERVE
DECLARE DYNAMIC/CUSTOMTYPE LIBRARY and _OFFSET are advanced, and not correctly implemented in QB64.
$CONSOLE, $SCREENHIDE, _SOURCE, _DEST, and $CHECKING are advanced in QB64
_FILEEXISTS and _DIREXISTS (though they could be subject to race conditions)
_SCREENIMAGE
_LOADFONT and _MAPUNICODE are intermediate, but not the right way to do it.
_DISPLAY and _AUTODISPLAY are intermediate
_CONTROLCHR is intermediate
something like _KEYDOWN should be combined with something like INKEY$ or _KEYHIT in a single step.
_CLIPBOARD
_TITLE
_MEM is advanced and unnecessary in QB64. The whole thing is a mistake.
$INCLUDE is intermediate
the various _MOUSE functions
the various network functions
_LIMIT and _DELAY, of which _DELAY is much simpler in implementation.

Regards,
Michael

P.S. SHELL, ENVIRON$, and COMMAND$ are standard lib, not core lang. edited to move them.
P.S. forgot _DELAY and _LIMIT
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Qubic
QB64 Member Project - Martin Fractals version one
QB64 Member Project - Isolation
QB64 Member Project - Foursight
QB64 Member Project - Connect Four
QB64 Member Project - Inside Moves
QB64 Member Project - Blokus
QB64 Member Project - Touche
QB64 Member Project - Quarto
QB64 Member Project - Score 4
QB64 Member Project - Full Color LED Sign
QB64 Member Project - Dakapo
QB64 Member Project - Swirl
QB64 Member Project - 9 Board
QB64 Member Project - Dreamy Clock
QB64 Member Project - Domain
QB64 Member Project - Pivet version one
QB64 Member Project - Input
QB64 Member Project - OpenGL Triangles
QB64 Member Project - Exit
QB64 Member Project - Basic Dithering
QB64 Member Project - Othello
QB64 Member Project - Color Rotating Text
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Bowditch curve
QB64 Member Project - Rotating Background
QB64 Member Project - Color Triangles
QB64 Member Project - Splatter
QB64 Member Project - Martin Fractals version four
QB64 Member Project - Sabotage
QB64 Member Project - Kings Court
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Overboard
QB64 Member Project - Kings Valley verion one
QB64 Member Project - ARB Checkers
QB64 Member Project - Martin Fractals version two
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Line Thickness
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Amazon
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Spiro Roses
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Point Blank
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Rubix's Magic
QB64 Member Project - Algeria Weather
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Pivot version two