can you explain how i need to encode it as i am unable to do so.
Printable View
can you explain how i need to encode it as i am unable to do so.
Well, I made my own syntax... I noticed that it would be pretty hard to understand, so I'm working on a new way. I'm not doing so well. My dumb self just learned about the Split function so that should come in handy. The new format would be like:
Tag Name
Attribute
Attribute
Attribute
Attribute
Tag Name
Attribute
Attribute
and so on.
I'll post it here once I'm done... and I'll try to comment this time.
OK... you might understand this better now. I completely changed the Decode and UpdateProp subs and commented. :)
When I tried it I felt that double clicking on a tag in the tag window should insert a tag without any extras (ie you dont have to click apply)
Also it is a bit strange that you create a whole new instance of the program when you create a new file.
An MDI or closing the current file then opening a blank one from a template might be better.
I was hoping clickable tags meant something similar to HoTMetaL PRO and their 'tags on' view.
Want to give that a try?
i have some troubles with my new and open buttons. they ask if i want to save or not before doing the action but if nothing has changed from the defult text they still ask. Also for when i open a file it always moves the code down by a couple of lines each time i open it. how can i solve these problems. here is what i have for save:
VB Code:
If CommonDialog1.FileName = "" Then With CommonDialog1 .Filter = "HTML Pages|*.html" .DialogTitle = "Save" .ShowSave End With If CommonDialog1.FileName <> "" Then If Dir(CommonDialog1.FileName) = CommonDialog1.FileName Then Over = MsgBox("Do you want to overwrite the current file with this version?", vbYesNo + vbQuestion, "Save File") If Over = vbNo Then cmdSave_Click Else Open CommonDialog1.FileName For Output As #1 Print #1, RichTextBox1.Text Close #1 End If End If Else Open CommonDialog1.FileName For Output As #1 Print #1, RichTextBox1.Text Close #1 CommonDialog1.DefaultExt = "html" CommonDialog1.DialogTitle = "Save" End If c = False S
and here is what i have for open
VB Code:
CommonDialog1.Filter = "HTML Pages|*.html" CommonDialog1.DialogTitle = "Open" If c = True Then q = MsgBox("Do you want to save your file?", vbYesNoCancel + vbQuestion, "ASGSoft HTML Editor") If q = vbCancel Then Exit Sub If q = vbYes Then cmdSave_Click End If CommonDialog1.ShowOpen br = Chr(13) + Chr(10) If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Input As #1 Do Until EOF(1) Line Input #1, lineoftext$ alltext$ = alltext$ & br & lineoftext$ RichTextBox1.Text = alltext$ Loop Close #1 End If S CommonDialog1.Filter = "HTML Pages|*.html" CommonDialog1.DialogTitle = "Open" cmdUndo.Enabled = False
i am working on a find and replace and i am planning to add the following:
sytanx highlighter
Requited registeration
Icons by the Menus
Help file
if anyone knows anything useful about them could you please say so
We need more code than that. Is that Open or Save?
Post more of your code.
first one is save second one is open. can u please tell me what u exactly need
Why are you reading only one line at the time in your Open procedure? The reason your Save procedure is adding a new line at the end of the file is because that is the normal behaviour of the Print # statement. To avoid that add a semicolon after the Print # statement (marked as red in the code below).VB Code:
Open CommonDialog1.FileName For Output As #1 Print #1, RichTextBox1.Text[b][color=red];[/color][/b] Close #1
it doesn't add the line to the end it adds it to the top
Yes it does :). Well actually it adds it to the end as well, but you might not notice that unless you save the same document more then once without making changes to it. The reason it adds a newline at the top is because of the way you're reading the file. You currently have this code:Now think that you've just read the first line. What will alltext$ contain after that? It will contain a linebreak and then the first line you've just read. Why don't you use this code instead:VB Code:
Open CommonDialog1.FileName For Input As #1 Do Until EOF(1) Line Input #1, lineoftext$ alltext$ = alltext$ & br & lineoftext$ RichTextBox1.Text = alltext$ Loop Close #1VB Code:
Open CommonDialog1.FileName For Input As #1 RichTextBox1.Text = Input(LOF(1), 1) Close #1
but i can't test that at the moment. recently at my load event it has an error :
VB Code:
Private Sub Form_Load() l = Chr(13) + Chr(10) pre = "<HTML>" + l + "<HEAD>" + l + "<TITLE>New Page 1</TITLE>" + l + "</HEAD>" pre = pre + l + "<BODY>" + l + l + l + l + l + l + l + "</BODY>" + l + "</HTML>" RichTextBox1.Text = pre c = False S trapUndo = True 'Enable Undo Trapping RichTextBox1_Change 'Initialize First Undo RichTextBox1_SelChange 'Initialize Menus Show DoEvents End Sub
It highlights "Chr" and brings an error message saying "cannot find project or library "
isn't anyone able to help out?
If you get that error on the Chr function you've probably deselected the reference to the VBA library. Click Project > References and make sure that the "Visual Basic For Applications" library is selected.
I was selected but after i removed a control i no longer needs it worked perfect also after adding ur previous alteration for my code it still adds a line at the top when i save and then re-open
Can you show the Save and Load code you're currently using?
i have the following for open:
VB Code:
CommonDialog1.Filter = "HTML Pages|*.html" CommonDialog1.DialogTitle = "Open" If c = True Then q = MsgBox("Do you want to save your file?", vbYesNoCancel + vbQuestion, "ASGSoft HTML Editor") If q = vbCancel Then Exit Sub If q = vbYes Then cmdSave_Click End If CommonDialog1.ShowOpen br = Chr(13) + Chr(10) If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Input As #1 Do Until EOF(1) Line Input #1, lineoftext$ alltext$ = alltext$ & br & lineoftext$ RichTextBox1.Text = alltext$ Loop Close #1 End If S CommonDialog1.Filter = "HTML Pages|*.html" CommonDialog1.DialogTitle = "Open" cmdUndo.Enabled = False
and for save i have the following
VB Code:
If CommonDialog1.FileName = "" Then With CommonDialog1 .Filter = "HTML Pages|*.html" .DialogTitle = "Save" .ShowSave End With If CommonDialog1.FileName <> "" Then If Dir(CommonDialog1.FileName) = CommonDialog1.FileName Then Over = MsgBox("Do you want to overwrite the current file with this version?", vbYesNo + vbQuestion, "Save File") If Over = vbNo Then cmdSave_Click Else Open CommonDialog1.FileName For Output As #1 Print #1, RichTextBox1.Text Close #1 End If End If Else Open CommonDialog1.FileName For Output As #1 Print #1, RichTextBox1.Text Close #1 CommonDialog1.DefaultExt = "html" CommonDialog1.DialogTitle = "Save" End If c = False S
function C and S are :
VB Code:
Public Sub S() Z = CStr(CommonDialog1.FileTitle) If Z = "" Then Z = "Untitled" Me.Caption = "ASGSoft HTML Editor (" + Z + ")" End Sub Public Sub S() Z = CStr(CommonDialog1.FileTitle) If Z = "" Then Z = "Untitled" Me.Caption = "ASGSoft HTML Editor (" + Z + ")" End Sub
Hope that help
Hmmm.... I explained this a few posts ago. In this code:When you read the first line you let alltext$ be a new line + the first line you read. So that it's because you insert a new line before the first line you just have read. I wondered why you didn't read it in all at once instead of one line at the time since it will be much faster:VB Code:
CommonDialog1.ShowOpen br = Chr(13) + Chr(10) If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Input As #1 Do Until EOF(1) Line Input #1, lineoftext$ alltext$ = alltext$ & br & lineoftext$ RichTextBox1.Text = alltext$ Loop Close #1 End IfVB Code:
CommonDialog1.ShowOpen br = Chr(13) + Chr(10) If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Input As #1 RichTextBox1.Text = Input(LOF(1), 1) Close #1 End If
ok that solves this problem. my other problem is that when i creat a new document it asks if i want to save eventhough i made no changes? can you explain that as well please?
can somone help?
Well I see that you ask for the file to be saved if c = True. What is "c" and when do you set that to False?
is there a way i can send you the source. i don't want ot add it here.
UTGrim, nice app works well just few place you need to fix as i know you are not done.
also
VB Forum Policy says you can put your app Attachment but you are not aloud to put the Compiled .exe file as it might have viruses and other unknown functions
Read this for more...
Policy
i know that i don't want to put it here because people might take it and say it's theirs.
Mate, its doubtful. Everyone here wants to help. Theres probably 1 or 2 idiots here who would do that, and even they wouldn't read 2 pages of a thread to do so.Quote:
Originally Posted by asgsoft
Besides, most of us have been where you are now. We've all created a HTML Editor. We're here to help :)
chem
chem
I trust your post that none will copy my work and that you are here to help me and there fore i will upload it. can anyone please do the following:
1- make sure the exe works (cut,copy,past,preview in browser stopped working)
2- Add icons to the menus or just show me how by doing it to one or two
3- Add a syntax highlighter
4- Make the user register and add data to registery and load it during startup
5- Add a serial number in the registeration form and say how you genrate them
And finally
Any other touches you might think are suitable
Thanks a million for your help.
BTW i am not planning to sell this and i don't intend to get any money from it so please offer the FREE. Herehttp://www.filelodge.com/files/6068/...l%20editor.zip
I couldn't upload here it said partiall attached
Nobody will run it unless you have the source code instead of an exe.
well if you check the file it has no exe it is the compelete source.
Is that all you want people to do? And it was you that was afraid that someone would after that call it their own program :)Quote:
Originally Posted by asgsoft
well i am sort of imbereesed to say this is worth 2.5 years work and i am very worried about it.
i take it no one can help me
MartinLiss has code in the codebank to use a serial number to register a program. See his signature, or search for it.
You can use the coolbar or toolbar to add images underneath a menu, but I don't think you can add images to the menu. Search the forums. There have been many examples.
well i've seen people add picture next to the menu text. thanks anyway
Oh, you're right. Bookmarks have them. Not sure how to do it though.