Copy and paste
BlitzPlus Forums/BlitzPlus Programming/Copy and paste
| ||
As Some might know I am new to B+ and as my first project I am making an IDE. I want to have a copy and paste feature in the menu, but cannot figure out how to put the text in the text field in to the clipboard. I have the menu written I just need to know how to make the menu item work. Thanks |
| ||
http://www.blitzbasic.com/codearcs/codearcs.php?code=699 |
| ||
Thanks agian. I am now working on trying to clear the text field when opening a file, it'll open a file and all, but it just adds it to the end of the currently opend one at the moment, but I have only been trying for a few minutes. |
| ||
Setgadgettext gad,"" |
| ||
that still didn't work. heres my code: Select event Case 1 Notify "you selected new" Case 2 filelocation$ = RequestFile("Open a File","bb,cpp,crx,c,h,hpp,b3d,doc,txt,htm,html") file = ReadFile(filelocation$) SetGadgetText(codearea,"") While Not Eof(file) tmp1$ = ReadLine(file) tmp2$ = tmp2$ +Chr$(13)+tmp1$ Wend AddTextAreaText(codearea,tmp2$) CloseFile(file) Case 4 filedir$ = RequestFile("Save Your Script","",True) file = WriteFile(filedir$) WriteString(file,code) CloseFile(file) Case 6 End End Select EndIf Forever Well part of it. Case 2 is where the open file code is. |
| ||
Did you clear all obsolete variables before reloading? If you keep data inside tmp2$ it will add the previous loaded text. |
| ||
Case 2 filelocation$ = RequestFile("Open a File","bb,cpp,crx,c,h,hpp,b3d,doc,txt,htm,html") file = ReadFile(filelocation$) SetGadgetText(codearea,"") While Not Eof(file) tmp1$ = ReadLine(file) tmp2$ = tmp2$ +Chr$(13)+tmp1$ Wend AddTextAreaText(codearea,tmp2$) tmp2$ = "" CloseFile(file) That works now, but it adds a space at the top. I know this is like a really simple bug, but i just can't find it. |
| ||
You are adding a chr(13) at the top before the first line is added. You can fix it by placing tmp2$ = readline(file) above the while nof eof(file) line. |
| ||
Yeah thanks! [url]http://www.s94678232.onlinehome.us/Downloads/crxide.rar[/url] That is the download link for the 2nd alpha build. |