Command Line Statements

DLR Basic (1.0.0.0) on .NET 2.0.50727.1433
(Ctrl-Z + ENTER to quit, specify file in command line to execute)
OK
A$="Hello"
OK
PRINT MID(A$,2,2)
el
OK
FOR I=1 TO 12 STEP 3:PRINT I;:NEXT:PRINT
 1  4  7  10
OK
IF 3=4 THEN ? "TRUE" ELSE ? "FALSE"
FALSE
OK


BASIC Program File Example

sqcalc.bas:
5 PRINT "SQUARE EQUATION CALCULATOR: A*X^2+B*X+C=0" 
10 INPUT "ENTER A,B,C";A,B,C
20 D=B*B-4*A*C
30 IF D<0 THEN PRINT "NO SOLUTIONS": GOTO 90
40 IF D>0 THEN 70
50 X=-B/(2*A): PRINT "ONE SOLUTION. X=";X
60 GOTO 90
70 X1=(-B-SQR(D))/(2*A):X2=(-B+SQR(D))/(2*A)
80 PRINT "TWO SOLUTIONS. X1="X1", X2="X2
90 END

Last edited Nov 11, 2008 at 9:10 PM by notmasteryet, version 2

Comments

No comments yet.