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
		RANDOMIZE
		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 
			ELSE 
				PRINT i*fnumber
			ENDIF
		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$
		
		END
		
		' Subroutine 1
		' Clear text variable
		
sub:	        PRINT "Subroutine"
		text$ = ""
		RETURN
		
		
		' Subroutine 2
		' Add a to text variable
		
sub2:        PRINT "Five"
		text$ = text$ + "a"
		RETURN	
	

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

Comments

No comments yet.