ASL Editior 2005

francisstokes
Ok.I've just started on my new VB project....an ASL Editor.

I plan to make it much like notepad, but with extras.

Such as:

say you start to make an "if" conditional,you write if and then it produces a drop down list of possibilites for the if statement like:

If here
%blah% = %blah%
NOT here

so on so forth.

Please let me know what you think.

METALGod32
sounds good to me, i say go for it.

007bond
Good idea.

I remember computer whizz wrote an ASL editor which had built-in syntax checking as well, but that was at least a couple of years ago that he wrote it.
You might want to ask him for a bit of help :)

francisstokes
I was hoping for help of computer whizz since hes the best programer on this site and i still a noob to VB.

I was thinking that for things like "define room" would be in green twxt when you type it and Things like that in specific text colours.

francisstokes
This is my FIRST version.It took me like 5 mins and it WILL get better.

http://www.geocities.com/francis.stokes14@btinternet.com/asleditor.zip

francisstokes
ok ive been testing my editor and already found 2 bugs.

Bug No. 1

While testing the editor on my laptop, i found saving the files saves the current file UNDER the rest of the file.I get this sort of effect:

define game

blah blah

define game

blah blah


Thats annoying.

Bug No. 2

When testing on my home computer, i found that saving the files does not do this, however, it does not save the file AT ALL.Also annoying.

Please let me know if you get any errors the same or *sigh* new ones.

Thanks

Cryophile
Read
http://www.axeuk.com/phpBB2/viewtopic.php?t=462

francisstokes
Umm, thanks.
I'm not quite sure what you were trying to tell me with that but im hoping that it wasnt discouraging.

The main reason im doing this is because im a total noob to VB and just wanted to get some practise...so i thought why not make something to do with quest so thats what im doining.

davidw
Why not write a game?

007bond
In answer ot your first bug:

When you open the file to save it, type:

Open "YourFileHere.asl" For Output As #1


Not:

Open "YourFileHere.asl" For Append As #1


By using the Output Method, it erases the file first, then writes to it again.
The append method simply adds to the end of the file.

francisstokes

Why not write a game?



I could ask you the same question (joking).

I am in fact writing a game, but im trying to learn to program, C++ was too hard and asl is too easy so i thought id take the middle way.

Thanks 007 ill try that now.

francisstokes
Ok 007 im actualy using this code:

   Dim Save As New SaveFileDialog
Dim myStreamWriter As System.IO.StreamWriter

Save.Filter = "ASL Files (*.asl)|*.asl|Text Files (*.txt)|*.txt"
Save.CheckPathExists = True
Save.Title = "Save"
Save.ShowDialog(Me)

Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(tbxEditor.Text)
myStreamWriter.Flush()
Catch ex As Exception
' Do Nothing
End Try


Im using the .net version and the language has changed quite a bit.

007bond
Sorry, I thought you were using VB6. Anyhow, It's still easy to locate the problem:

myStreamWriter = System.IO.File.AppendText(Save.FileName)


You can't use "AppendText". It will add it on to the end of the file, not replace the entire file. I don't know the VB .NET way of doing this though, so good luck!

francisstokes
Looks like im gonna be doing some google crawling tonight.

Thanks anyway,

007bond
go to http://www.planet-source-code.com. That's always lots of help

francisstokes
Ok.I found my solution.I had to
CreateText
insted of
AppendText
.

Now i have a new problem.The editor completely eats the code!It doesnt put any new lines in or anything.

francisstokes
Ok.Ive now fixed that error aswell.This is now a fully fuctional text editor.Now i just have to add some features that will make people want to use it.

download the current version here: http://www.geocities.com/francis.stokes14@btinternet.com/editor.zip

paul_one
My source code is available from my older website ( http://www.compwhizz.freeserve.co.uk/ ) I think.
Although it's been abandoned for the time being while I do other stuff.

francisstokes
I downloaded your source tron.Were you trying to make the text go different colours for certain keywords like 'define'?

paul_one
Trying? No.
I succeeded - although it was slightly slow, especially if you had a long list of different "keywords".

If I thought about it more I'd seperate them into different lengths of "words", track back to the space and go through that shorter list. If a string of 'words' are used (ie "define game" instead of "define text") then you use some sort of diverging algorythm to have "define" split off into two different scenario's and only colour it when the last bit is added.

... I just didn't care too much about it.

What I really wanted to get going was an easy object/room creator, a list of all objects/rooms, and stuff like that. Never got round to that either.

This topic is now closed. Topics are closed after 14 days of inactivity.

Support

Forums