Is there any help or wiki or anything for scripting?
I can't find anything.
There should be a STICKY at the top of this forum that gives some
basic information.
I wanted to write a script, so I looked at it/them, and couldn't find
any information or help, and see that there are several scripting
languages, so I don't even know where to start.
Most editors don't even have one scripting language, much less several
to choose from.
This forum has a bunch of information, but, again, where would
a person even start to read?
Help with/for Scripting
Help with/for Scripting
RJTE version 16.36 (Actual) - 64-bit
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Re: Help with/for Scripting
I found some info in help.
But I can't even figure out how to do a simple search,
much less a regex search.
All I want to do is find the QB64 FUNCTION or SUB routine in the editor
using the selected text or the word the cursor is on (or at the front or rear of)
if no selection.
So the regex would be something like:
^(FUNCTION|SUB) +name
And, since "name" can have '$' and possibly other regex characters,
I either need to slash-quote it or use a function that does that. Like:
^(FUNCTION|SUB) +PARSE\$
So it's a relatively simple script, if you know how the scripting stuff works.
I would also like Previous FUNCTION/SUB and Next scripts so I can quickly
jump up and down through routines. (maybe an "End of FUNCTION/SUB" script)
But I can't even figure out how to do a simple search,
much less a regex search.
All I want to do is find the QB64 FUNCTION or SUB routine in the editor
using the selected text or the word the cursor is on (or at the front or rear of)
if no selection.
So the regex would be something like:
^(FUNCTION|SUB) +name
And, since "name" can have '$' and possibly other regex characters,
I either need to slash-quote it or use a function that does that. Like:
^(FUNCTION|SUB) +PARSE\$
So it's a relatively simple script, if you know how the scripting stuff works.
I would also like Previous FUNCTION/SUB and Next scripts so I can quickly
jump up and down through routines. (maybe an "End of FUNCTION/SUB" script)
RJTE version 16.36 (Actual) - 64-bit
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Re: Help with/for Scripting
Ralph,
I may be wrong on this, but I believe RJ TE uses FastScript as its scripting engine:
I may be wrong on this, but I believe RJ TE uses FastScript as its scripting engine:
I once intended to give scripting a go, but... well, yeah, no time. Anyway, here: http://www.fast-report.com/en/support/ you can find some documents to download, plus FAQs, newsgroups and a forum. Hope that helps!FASTSCRIPT - multi-language scripting engine
FastScript is a cross-platform, multi-language scripting engine. It is useful for programmers who want to add scripting ability to their projects. FastScript can be installed in Embarcadero (ex Borland and CodeGear) Delphi 4-XE2, C++Builder 4-XE2, Kylix 1-3 and Lazarus.
An unique feature of FastScript is its ability to use several languages (PascalScript, C++Script, JScript and BasicScript). This allows you to write scripts using your favorite language. FastScript doesn't use Microsoft Scripting Host, so it can be used in both the Windows and Linux environments.
FastScript offers a wide range of features, including cross-platform scripting, fast code execution, a small footprint, a great variety of tools, and excellent scaling options. Use FastScript to make your applications really flexible and powerful!
http://www.fast-report.com/en/products/fast-script.html
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
Re: Help with/for Scripting
I'm not sure you can do a regex search in a script (though that would be nice). While a regex would make it easier, it's certainly not necessary in this case. Here are a few pointers:rjbill wrote:ISo it's a relatively simple script, if you know how the scripting stuff works.
- - Get the current selection using Document.SelText()
- Modify the selection if necessary using Document.CursorWordLeft(true) and Document.CursorWordRight(true)
- Get the number of lines in the document using Document.LineCount()
- Iterate through the lines of the file (up or down) using a simple for loop, and reference the current line using Document.Lines(i), where i is your loop indexer.
- Search for some text in the current line using the Pos(substring, string) function
- Move the cursor using the Document.CursorX and Document.CursorY properties
Jeff
Re: Help with/for Scripting
Thanks.
I figured out the FastScript thing.
But it has been 'attached' to the editor, with editor objects
and methods and properties and such, which are proprietary.
I figured out the Document.SelText and a couple of other things,
but didn't want to do a hardcoding-type implementation.
I guess Rickard is just adding stuff to the interface as he can and wants to.
It's strange that it doesn't do regex searches and replaces.
I couldn't even find "search", just "replace all".
Maybe someday there will be better documentation.
I figured out the FastScript thing.
But it has been 'attached' to the editor, with editor objects
and methods and properties and such, which are proprietary.
I figured out the Document.SelText and a couple of other things,
but didn't want to do a hardcoding-type implementation.
I guess Rickard is just adding stuff to the interface as he can and wants to.
It's strange that it doesn't do regex searches and replaces.
I couldn't even find "search", just "replace all".
Maybe someday there will be better documentation.
RJTE version 16.36 (Actual) - 64-bit
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Re: Help with/for Scripting
I'm not sure I follow. You don't really need to "hardcode" anything outside of the actual search logic. The script can certainly operate on the selected item, or select the item to the left or right as you suggested based on whatever logic you want to employ.rjbill wrote:I figured out the Document.SelText and a couple of other things,
but didn't want to do a hardcoding-type implementation.
The current scripting interface is definitely a little "light" in some areas, though it seems to have the basic machinery necessary to do lots of common things - including what you're trying to do. That said, some additions could make it easier. Rickard has added a few things for me as I've needed them, so I'm sure he's not opposed to User requests...rjbill wrote:I guess Rickard is just adding stuff to the interface as he can and wants to.
I find that poorly documented scripting is the downfall of many "scriptable" applications. However, I think RJTE's scripting docs are *much* better than some other scriptable apps I've dealt with (though they could certainly be improved also).rjbill wrote:Maybe someday there will be better documentation.
Jeff
Re: Help with/for Scripting
I meant "brute force" (not hardcoding-type), rather than a more elegant solution.
In some ways the docs are good. However, that doesn't help due to the proprietary
nature of the implementation, so they might as well not be there at all.
It's like if you got a programming language manual that listed all of the commands,
but didn't tell you what they did, what the parameters are (rather than just type), etc.
That would be pretty useless. (unless there was other info around the net that
you could find to piece it all together)
In some ways the docs are good. However, that doesn't help due to the proprietary
nature of the implementation, so they might as well not be there at all.
It's like if you got a programming language manual that listed all of the commands,
but didn't tell you what they did, what the parameters are (rather than just type), etc.
That would be pretty useless. (unless there was other info around the net that
you could find to piece it all together)
RJTE version 16.36 (Actual) - 64-bit
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Re: Help with/for Scripting
I guess it depends on how badly you want the custom functionality. You can certainly create it now (with no scripting enhancements), though it may take a little more effort on your part than you might have hoped.rjbill wrote:I meant "brute force" (not hardcoding-type), rather than a more elegant solution.
Jeff
Re: Help with/for Scripting
In addition to my above reply, see this topic:
http://www.rjsoftware.se/Forum/viewtopi ... =11&t=1982
Jeff
http://www.rjsoftware.se/Forum/viewtopi ... =11&t=1982
Jeff
-
- Posts: 28
- Joined: 08 Jun 2011 17:14
Re: Help with/for Scripting
If you do a regex search in RJ TextEd, and then run a script, the script's Document.ReplaceAll() lines will use regex. In older versions of RJ TextEd, you did not have to do a regex search, only to activate the RJ TextEd's button, but it changed at some point.
Regards
Regards