DevStudio 1.01

BlitzPlus Forums/BlitzPlus Programming/DevStudio 1.01

JoshK(Posted 2005) [#1]
This BlitzPlus-written IDE was abandoned until recently, when I found a way to control a textarea's cursor position. The editor has basic functionality, and room for expansion in the language a Blitz IDE is meant to be written in.

Download


Kuron(Posted 2005) [#2]
Doesn't seem to work. It generates an "invalid stream handle" error and thats it.


William Miller(Posted 2005) [#3]
Halo,

Does this have a size limit on the source code it will open?

It would not open either of my two main projects, source
code totals of about 7000 lines and 16000 lines respectively -- the program froze up and stopped responding a couple of minutes after I tried to open either of those (it never displayed any code, just an intermittent hourglass).

William Miller


JoshK(Posted 2005) [#4]
Probably is just taking a long time to format it.

Why the hell have you got 16,000 lines in a single .bb file?


William Miller(Posted 2005) [#5]
Halo asked: Why the hell have you got 16,000 lines in a single .bb file?

Because the total program size is about 55,000
lines, the main program is 16K ;-)

Thats really not big as programs go: I also work on a program that has > 750,000 LOC total (this is in Visual Studio 6.0), with some class files being over 40,000 LOC.

William Miller


JoshK(Posted 2005) [#6]
How does that translate into kb?


William Miller(Posted 2005) [#7]
Halo: "How does that translate into kb?"

The main bb source file of 15.5K LOC is about 505Kb, the
total source file size is on the order of 1.94Mb.

Unless you mean the C++ source code, thats somewhere about
26Mb in size counting headers:-)

William Miller


JoshK(Posted 2005) [#8]
Holy crap, the CShop 4 source is only like 641 kb.


Big&(Posted 2005) [#9]
26Mb source file!
Glad I was sat down when I read that! :)


Big&(Posted 2005) [#10]
Had a mess with the Line Format function.

Got the Keyword highlight working so that if you had more than one occurrence of a keyword on a line, it highlights them all.

Got numbers working.

Changed the precedence of Strings and Comments. It was highlighting wrong if you had ";" in your code.

Tried speeding stuff up reading the keywords into an array but that seemed to slow it down (thought an array might have been faster than a type).

Function FormatLine(textarea,linenum)
	char=TextAreaChar(textarea,linenum)
	length=TextAreaLineLen(textarea,linenum)
	s$=TextAreaText(textarea)
	codeline$=Mid(s,char+1,length)

	FormatTextAreaText textarea,PLAINR,PLAING,PLAINB,0,char,Len(codeline)

	If Not Len(codeline) Return

	;Strings
	p=1
	While p
		p=Instr(codeline,Chr(34),p)
		If p
			p2=Instr(codeline,Chr(34),p+1)
			If p2=0 p2=Len(codeline)
			FormatTextAreaText textarea,STRINGR,STRINGG,STRINGB,0,char+p-1,p2-p+1
			kf=Len(codeline)
			codeline=Left(codeline,p-1)+String(Chr$(160),p2-p+1)+Right(codeline,Len(codeline)-p2)
		EndIf
	Wend

	;Comments
	p=Instr(codeline,";")
	If p
		FormatTextAreaText textarea,COMMENTR,COMMENTG,COMMENTB,0,char+p-1,Len(codeline)-p
		codeline=Left(codeline,p-1)
	EndIf
	If Not Len(codeline) Return

	;Keywords
	Repeat
		found=0
		lcodeline$=Lower(codeline)
		For k.keyword=Each keyword	
			p=Instr(lcodeline,k\lword,0)
			If p
				spacer=Asc(Lower(Mid(codeline,(p-1),1)))
				If spacer<97 Or spacer>122
					spacer=Asc(Lower(Mid(codeline,(p+Len(k\lword)),1)))
					If spacer<97 Or spacer>122
						SetTextAreaText textarea,k\word,(char+p-1),Len(k\word)
						FormatTextAreaText textarea,COMMANDR,COMMANDG,COMMANDB,0,(char+p-1),Len(k\lword)
						p2=p+Len(k\word)
						codeline=Left(codeline,p-1)+String(Chr$(160),p2-p+1)+Right(codeline,(Len(codeline)-p2))
						found=1
						Exit
					EndIf
				EndIf
			EndIf
		Next
	Until found=0

	;Numbers
	start=0
	Repeat
		ch=Asc(Mid$(codeline,start,1))
		If ch>47 And ch<58
			spacer=Asc(Mid(codeline,(start-1),1))
			If spacer<97 Or spacer>122
				For i=start To Len(codeline)
					cn=Asc(Mid(codeline,i,1))
					If cn<48 Or cn>57
						sp$=Mid(codeline,(start-1),1)
						If sp="$" Or sp="%"
							start=start-1
						End If
						FormatTextAreaText textarea,NUMBERR,NUMBERG,NUMBERB,0,(char+start-1),i-start
						start=i
						Exit
					End If
				Next
			End If
		End If
		start=start+1
	Until start>Len(codeline)
End Function



JoshK(Posted 2005) [#11]
Put lcodeline$=Lower(codeline) outside of the repeat loop.


Big&(Posted 2005) [#12]
The lcodeline needs updating inside the loop as we delete the formatted keyword in codeline.

Also, in the numbers section:
spacer=Asc(Mid(codeline,(start-1),1))

needs replacing with:
spacer=Asc(Lower(Mid(codeline,(start-1),1)))

I had messed up on that. It was marking variables with numbers in them.