I've created a demo application for MFBasic showcasing the most used routines/control structures it uses the MFBasic program below:

' This is the start of the demo application
' This program showcases the use of MFBasic

		' Sample string variable
		text$ = "Hallo world!"
		' Move to sub
		GOSUB sub
		' Call routines and print output of numeric function
		PRINT INT(RND()*1000*10)
		' Create new floating point variable from function result
		fnumber = CINT(9.8)
		' For, Next loop
		FOR i = 1 TO 10
			IF i <= 5 THEN 
				GOSUB sub2 
				PRINT i*fnumber
		NEXT i
		' Text should be aaaa else a program error occourd
		IF (text$="aaaaa") THEN PRINT "Ok!"
		' End of this demo program
		PRINT "End Of Program"
		PRINT text$
		' Subroutine 1
		' Clear text variable
sub:	        PRINT "Subroutine"
		text$ = ""
		' Subroutine 2
		' Add a to text variable
sub2:        PRINT "Five"
		text$ = text$ + "a"

Last edited May 19, 2009 at 6:09 PM by elzekool, version 1


No comments yet.