fb:porticula NoPaste
BasicInterpreter (Testversion, aber der Code funzt ;)
Uploader: | AndT |
Datum/Zeit: | 05.08.2007 22:22:03 |
Function FindeLinks(Eingabe as String,Zeichen as String) as string
dim as integer Position
dim as string Befehl,Char
Befehl = Left(Eingabe, Instr(Eingabe, Zeichen)-1)
FindeLinks=Befehl
end function
Function FindeAnhang(Eingabe as String,Zeichen as String,Befehl as String) as string
dim as integer Position
dim as string Befehl2,Char
Befehl2=Mid (Eingabe,Len(Befehl)+1,Len(Eingabe)-Len(Befehl)+1)
FindeAnhang = Befehl2
end function
SUB myNormalPrint (StringA as String)
Print StringA
end sub
Sub myFilePrint (StringA as String, FileNr as byte)
Print #Filenr,StringA
end sub
sub myFileOpen (Filename as String,FileTyp as integer, FileNr as integer )
Select case FileTyp
case 1
Open Filename for input as FileNr
case 2
Open Filename for output as FileNr
case 3
Open Filename for random as FileNr
case 4
Open Filename for binary as FileNr
end select
end sub
Function myFileGet (FileNr as ubyte,Position as ulongint,StringToGet as Ubyte) as Ubyte
get #Filenr,Position,StringToGet
myFileGet=StringToGet
end function
sub myScreen (Scr as Integer)
screen Scr
end sub
sub myLine (x1 as integer,x2 as integer,y1 as integer,y2 as integer,linecol as integer)
line (x1,y1)-(x2,y2),linecol
end sub
Function AnzahlderBefehle(dateiname as string) as integer
If Dateiname = "" Then Print "Keine Datei angegeben!":AnzahlderBefehle=-2:exit function
open dateiname for input as #1
dim as integer anzahl,dummy
do
anzahl + =1
input #1,dummy
loop until eof(1)
close #1
AnzahlderBefehle = anzahl
End Function
dim as string dateiname,tmpdata
dim as integer anzahl,nr
dateiname = command
anzahl = AnzahlderBefehle(dateiname)
If anzahl < 0 Then Print "Fehler (Keine Datei angegeben oder Datei konnte nicht geladen werden!!!)":sleep:end
Print "Laden..."
dim as String Befehl(1 to anzahl)
open dateiname for input as #1
For nr=1 to anzahl
input #1,Befehl(nr)
Next
Print "Laden abgeschlossen."
Print "Programm startet..."
dim as string cmd,cmdd
dim as integer d1,d2,d3
nr=0
Do
nr+=1
cmd=findelinks(Befehl(nr)," ")
if right(cmd,1)="=" then Print "String gefunden.. >>noch<< keine Möglichkeit etwas damit anzufangen ;)"
cmdd=findeAnhang(Befehl(nr)," ",cmd)
select case lcase(cmd)
case "print"
tmpdata=cmdd
tmpdata = right (tmpdata,len(tmpdata)-1)
if left (tmpdata,1) = """" THEN
tmpdata = right(tmpdata,len(tmpdata)-1)
d1=1
if right(tmpdata,1) = """" THEN tmpdata = left(tmpdata,len(tmpdata)-1)
else
If d1=1 Then Print "Bitte Zeile(";nr;" ) ueberpruefen."
end if
mynormalprint tmpdata
case "goto"
nr=val(cmdd)-1
end select
loop until nr = anzahl