1. Code Genie goto error line
- Posted by Brian Broker <bkb at cnw.com> Jul 30, 2002
- 376 views
This is not very smart in that you must have the file containing the error open and with focus. Also, if the error is in an include file that's not in the same directory as your program (and ex.err) then it won't help you. It might be better to use a RegExp object to parse ex.err but I'm not very good with regular expressions and this seems to do the job anyway. I have a Euphoria.vbs file in my Macros folder with the following routine: Sub JumpToError Dim fso, file, line, errline Const ForReading = 1 Set fso = CreateObject("Scripting.FileSystemObject") Set file = fso.OpenTextFile(Doc.FileDir&"ex.err",ForReading) line = file.ReadLine errline = Right(line,len(line)-InStrRev(line,":")) line = line & vbCr & file.ReadLine ' show first two lines of ex.err in a MsgBox Doc.MsgBox line ' set cursor to error line Doc.SSE = Doc.LineToPos(CInt(errline)-1) file.Close End Sub Then you can add the following shortcut at the end of cgenie.conf: Shortcut Euphoria.vbs JumpToError F8 It's just a start and if I can figure out how to make it smarter then I'll post it to the list. Or if anybody else is good with scripting then post your solution for us. -- Brian 10963508 wrote: > This is the editor I have been looking for. > Did any euphoria programmer write these macros, to save me some time: > > F5: execute program > F8: go to error line
2. Re: Code Genie goto error line
- Posted by 10963508 at europeonline.com Jul 31, 2002
- 388 views
I tried this sub and it works but Code Genie needs to have a way to open documents with macros. Till then it will not be possible to go to error line in include files easily. ----- Original Message ----- From: "Brian Broker" <bkb at cnw.com> To: "EUforum" <EUforum at topica.com> Subject: Code Genie goto error line > > This is not very smart in that you must have the file containing the > error open and with focus. Also, if the error is in an include file > that's not in the same directory as your program (and ex.err) then it > won't help you. It might be better to use a RegExp object to parse > ex.err but I'm not very good with regular expressions and this seems to > do the job anyway. I have a Euphoria.vbs file in my Macros folder with > the following routine: > > Sub JumpToError > Dim fso, file, line, errline > Const ForReading = 1 > > Set fso = CreateObject("Scripting.FileSystemObject") > Set file = fso.OpenTextFile(Doc.FileDir&"ex.err",ForReading) > > line = file.ReadLine > errline = Right(line,len(line)-InStrRev(line,":")) > line = line & vbCr & file.ReadLine > ' show first two lines of ex.err in a MsgBox > Doc.MsgBox line > ' set cursor to error line > Doc.SSE = Doc.LineToPos(CInt(errline)-1) > file.Close > End Sub > > Then you can add the following shortcut at the end of cgenie.conf: > > Shortcut Euphoria.vbs JumpToError F8 > > It's just a start and if I can figure out how to make it smarter then > I'll post it to the list. Or if anybody else is good with scripting > then post your solution for us. > > -- Brian > > 10963508 wrote: > > This is the editor I have been looking for. > > Did any euphoria programmer write these macros, to save me some time: > > > > F5: execute program > > F8: go to error line > > > >