Implement additional language or call .dll-funcs?

Make a request or discuss new features.
Post Reply
ReneMiner
Posts: 7
Joined: 27 Mar 2021 08:22

Implement additional language or call .dll-funcs?

Post by ReneMiner »

Hello, i enjoy RJ-Texted very much - it"s one of the few that does not break down when i feed it with the keywords of my favourite programming language and thats around 7000 keywords. no typo...
Since the language is (and always will be) still under developement and the coding+editor shipped with it has a couple of weaknesses so i decided to user your editor and customize - or better: to specialize it. i.e. reduce a few languages and keep only highlighters of commonly with "thinBasic" used files. (put 3w+dot in front and add .com if you want to know).
Its an interpreter so scripts run uncompiled but incredible fast directly from commandline.

It's not a problem to invoke the files but the problem i stumbled across is, when RJ-TextEd is as portable version on a users system it will not add any settings to the registry where the mainApps data path is to find and also the tools-window gives plenty of choices about the filepath and name but i miss like a variable that is related to / dedicated to a "\user defined" subfolder for "\tools"

When i would like to publish my language-implementation i must be sure where to place for example the launcher which will after execution check for an error-log and send a message what file, what line to show and what token to highlight and of course what error message to display in the message output / if any occured.

No matter how - it were already a help to know if any variable exists that returns at least the MainApp.Path without to run a script before i call another script to launch the script of the user.
I am talking about the dialog that opens from menu "configure tools" (it's caption is "Options") when i select some tool i can click an "Edit-Button" and another dialog opens where i can set path, script or exe, cmd/settings etc. Some dropdown-boxes offer me drive, parh, file, extension or all together but none of the variables points where i would store some tools or dictionary/files

And what i also wanted to ask:

is it possible to Declare functions of a .dll within a fastscript-script and to call them from fastscript?
____________________________________________________________________________________________

And another small issue that i found regarding search & replace in textEd:
search and mark the matches (around 7000 commas in a maybe 150 kB file : less than a second, very fast, no complain, great code: It marks and selects the chars to replace in no time flat.

But when it comes to replace then:

You know the size of each string that is to replace and the size of the replacement, the count of replacements and initial length as well
Dimensioning dynamic strings is one of the slowest operations that pcs perform. and if it replaces word by word and always redimensions the string for that makes it need way more than 5 minutes when it only should need a few seconds. Calculate the final length before starting to replace, allocate the required memory once and build the string upon it - as a suggestion.
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Implement additional language or call .dll-funcs?

Post by pjj »

ReneMiner wrote: 27 Mar 2021 09:46 And another small issue that i found regarding search & replace in textEd:
search and mark the matches (around 7000 commas in a maybe 150 kB file : less than a second, very fast, no complain, great code: It marks and selects the chars to replace in no time flat.

But when it comes to replace then: (...) it need way more than 5 minutes when it only should need a few seconds.
Just did a test, with 3,6MB PHP file: replacing 22k asterisks with 8-char string was instantaneous, same with 19k commas. I thought it could have been due to highlighter being used, but no, I didn't have to switch it off, so I guess it may be somehow specific to your case.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
ReneMiner
Posts: 7
Joined: 27 Mar 2021 08:22

Re: Implement additional language or call .dll-funcs?

Post by ReneMiner »

i guess it was the way i invoked the search, i tried using a regular expression to replace \x0D \x0A (cr lf) since i had 6000 comma/seperated keywords in just like 10 or 12 lines and to check if my regex was correct i had the search & replace on bottom of the mainwindow opened and i tried alwas just one until i have found the correct way to write it/ it did expect a space inbetween while i tried upper case lower case, brackets, parenthesis etc. and always i did one single replacement. when i had the correct setup i just let it run - but it was dissapointing to see errr... not to see any movements on screen. Its a minor problem, What i really think to protect the users data (yes those users are tampering around, tinker here poke there, write something - try to launch it...
All fine but i would would love it if the editor (when set to auto-save on changes) would create a backup before any change is made to some document at all.

i know, open scripteditor use commandline,
7z.exe a ProtectMyFiles.7z [CurrentDir]*.* -r and have the whole directory archivednext time the script will just check if it made a backup today/ or this week already

I would appreciate if the console that is used as stdout were useable to type in direct commands not commandline only but- even scriptcommands don"t know if it must compile the scripts but i would just save the user-input as a script that is predefined maybe has some variables for calculations and a shortcut as "? hex(123,4)" the print-sign alias question mark finalizes the live/console/script and sends it to execution; if error - no error, no no no...take the user input and send it to OS maybe there is some use for it :)
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Implement additional language or call .dll-funcs?

Post by pjj »

ReneMiner wrote: 28 Mar 2021 00:56 i guess it was the way i invoked the search, i tried using a regular expression
Ah, so it was a regex S&R. I can imagine it takes some time, since it differs from the regular one. But
ReneMiner wrote: 28 Mar 2021 00:56 to replace \x0D \x0A (cr lf)
to replace newline you don't really need regex. In modal window search click on the first icon after searchbox and hit enter; a pipe-like character will be inserted, that represents newline.
ReneMiner wrote: 28 Mar 2021 00:56 All fine but i would would love it if the editor (when set to auto-save on changes) would create a backup before any change is made to some document at all.
It does, doesn't it? I never used nor autosave neither backup function, but there are setting for exactly this, cf. Options > File > Backup > Saved files > Auto saved files.
ReneMiner wrote: 28 Mar 2021 00:56 i know, open scripteditor use commandline,
7z.exe a ProtectMyFiles.7z [CurrentDir]*.* -r and have the whole directory archivednext time the script will just check if it made a backup today/ or this week already
Shameless plug.
ReneMiner wrote: 28 Mar 2021 00:56 I would appreciate if the console that is used as stdout were useable to type in direct commands not commandline only but- even scriptcommands don"t know if it must compile the scripts but i would just save the user-input as a script that is predefined maybe has some variables for calculations and a shortcut as "? hex(123,4)" the print-sign alias question mark finalizes the live/console/script and sends it to execution; if error - no error, no no no...take the user input and send it to OS maybe there is some use for it :)
Integrated terminal, something like VSC has, could be a thing! I don't have any idea right now how I would use it, but I suppose it could be pretty handy once in a while.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Implement additional language or call .dll-funcs?

Post by pjj »

ReneMiner wrote: 27 Mar 2021 09:46 is it possible to Declare functions of a .dll within a fastscript-script and to call them from fastscript?
The only one to answer this question authoritatively is Rickard. I did a quick Google search to find one ancient forum thread, in which FS author says that
No chance at all - it will require total redesign of the engine.
so I guess the answer from Rickard would be "no" as well.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
ReneMiner
Posts: 7
Joined: 27 Mar 2021 08:22

Re: Implement additional language or call .dll-funcs?

Post by ReneMiner »

i saw it but as "\r \n" , the "|" with the gap did not do anything It was inserted but that was about all. it did not find any matches

I think it was the issue that i started to go for single matches what made it take that long when i wanted all at once.


to replace newline you don't really need regex. In modal window search click on the first icon after searchbox and hit enter; a pipe-like character will be inserted, that represents newline.
...shame on me i did not read that before...
HomeBoard index
[script] Automatic backup of daily changes

Search this topic…
but anyway, should be not that difficult to check the input for any known keywords or provided variables that will let the user have meantime-results on more complicated evaluation, and if its not useable what the user typed - perhaps he has some commandline/tool that will accept and reply.
In any case it were nice if a part of the editor had a dedidcated area for command-input so the console will not cover the editors workspace and the user could query things without the need to run a big script or could adjust settings to the editor which are built in but are not represented by any button in the GUI, probably the fastscript-java-engine were the one that i would use becase the variables are variant by default and accept anything since that runs with variants and not limited vartypes. Like to have a "clm" to clear memory, sets variables 0 or "", "cls"
- clear screen, "clr" clear all, initial or final "?" = query/request for a result. (execute internal function like "!" or just enter to evaluate i think i have read something a while ago how to make a standard textbox within a window .to behave as command prompt...
https://www.codeguru.com/columns/vb/usi ... -form.html

and yes i found in fastscript forum at fast+<any thinkeable> somewhat that says like "never ever" but i do not think the one who posted it had an idea what he posted. A few pages later i 've found the truth: fastscript is not using the windows scripting host to stay independend and run on any environment, And fastscript has implemented iDispatch objects. Thats like any .dll were already implemented :-D :D
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Implement additional language or call .dll-funcs?

Post by pjj »

ReneMiner wrote: 28 Mar 2021 12:17 but anyway, should be not that difficult to check the input for any known keywords or provided variables that will let the user have meantime-results on more complicated evaluation,
Have you clicked on the third icon (in the modal search box)? You could find Regular expression creator there, you know ;)
ReneMiner wrote: 28 Mar 2021 12:17 and yes i found in fastscript forum at fast+<any thinkeable> somewhat that says like "never ever" but i do not think the one who posted it had an idea what he posted.
It might have been implemented later, because the one you think had no idea was FastScript creator himself 8)

I had a feeling you asked about implementing another scripting language, but I couldn't find it anywhere in your post :lol: Well, it's only in the subject. Anyway, you're not the first one to come up with such idea.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
ReneMiner
Posts: 7
Joined: 27 Mar 2021 08:22

Re: Implement additional language or call .dll-funcs?

Post by ReneMiner »

It might have been implemented later, because the one you think had no idea was FastScript creator himself 8)

I had a feeling you asked about implementing another scripting language, but I couldn't find it anywhere in your post :lol: Well, it's only in the subject. Anyway, you're not the first one to come up with such idea.]
The way to use it is very easy as soon as a custom tool saves the location of the editor on the harddrive 9simply let cmd echo %~dp0 ) its connecte. not required to compile any dll if direct communication aor manipulation is desired create an iDispatch variable - the languages introduce each other, i.e. give a short information what properties they have and what methods are available. a verbose information is to get on demand also. pretty simple - only problem to catch a mutex when i want to get the text of any document so its to wait until the user runs a script or just grab the text from textEd. when i sit live next to it that looks quite easy because the focussed tab button shows the connection between scriptname and control, i might just count pixels... i will post a small script soon, after i installed a new windows -on that thing in front of me.
Post Reply