Author Topic: Explorerview as control to embedd or dock to an editor/window?  (Read 16198 times)

ReneMiner

  • Newbie
  • *
  • Posts: 5
    • View Profile
Hi all,
just a question about something that's errrr...- logic?

No fear i will not ask to release sourcode nor to rip a piece out of the commander   ;D

I would like the multifunctionality of the commander implemented to customize my favourite texteditor to use it for managing all about projects using my favourite scripting language - when I see what you developed and when i look on what RJ - the developer of the texteditor - created then i think it would be win/win for all.  His "Texted" provides the environment for your scripting- and plugIn-System and even if both programs will not merge into the same window - they could dock, share the same desktop and one is for the editing and correctness in text while the other will securely will keep track on the locations where the documents are stored.

And of course it were cool to use the features like search in files to bring documents into the view and it were certainly no big deal to create syntax-highlighting and intellisense-driven autocomplete for multiscriptand if i take a look at the document viewer and look to the commanders interface i can see clearly what to develop is more fun and more important to you  ;)

- - -

And mentioning that,  i miss urgently some string functions that can work based on the count of chars and repeatedly search for matches starting from a given position again or to TrimCharsLeft or TrimCharsRight by a number that says how many to cut.

Intentionally "TrimChars" and not "String"but without a keyword  as operation that could be doable by operator signs to a string As well as AddChars
If this means left < and this means right > and this $s1 &= $s2 is regular append  $s2 to $s1 in an LTR-language  then it would be  =& in RTL/systems. Where also the characters are in opposite direction then.
    $s1<& $s2    pads   $s1 with $s2 in front, equal to $s1 = $s2 & $s1 
    $s1>& $s2   does the same as $s1 = $s1 & $s2 or s1 &= $s2
       operator   & as a symbol for concatenation
      this one /  a symbol to divide / cut /separate
 TrimCharsLeft :     $string</ $number                $s1 </ 7 truncate 7 characters on the left of $s1
 TrimCharsRight:  $string >/ $number             $s2 >/ 5 cut 5 from the right.

 kind of a reverse operating Right$() and Left$()-functions while the Mid$() already exists - even it has only the length of 1 char but $string[4...9] were like chars "456789" : anyone instantly understands this
 $string[4(9)] says somehow we had 9 chars and start at position 4... doesnt it?

Improving StrFind to StrFindNext that had 1 additional parameter to determine where to start search and return relative from starting position that were about the simple string-handling without to add more keywords.

Left$, Mid$ or Right$ read all really so like 1984 ... but i am not done yet.

 i also miss a way to iterate trough a string step by stepand i imagine like a "When-loop" - not really a counter-functional to "For" nor "While"  working loop that keeps repeating as long as a variable remains in a certain state and modifies a second variable as a reaction to each additional begin of iteration.
 the initial execution were to remember the value of the conditional variable and to do the operation to the second variable with the third expression not necessary math operation but appending a char. i hope this is understandeable:

 
Code: [Select]
@var $text = LoadStringFromFile(...somewhere...);
@var $verb = "Find Me!";
@var $position = 0;
@var $matchcount = 0;

when( $position++; matchcount += 1 )
{
   
  $position += StrFindNext( $text, $verb, $position );

# do something and repeat when $position increasesd
   
}
# goes out of scope when $position was not increased (++), decremented (--) or changed (==)

Q: could there be global constants that are valid in all scopes of a script?
for example
Code: [Select]

@permanent -1 ->$_NOTHING_$;
a "real const" that looks different from variables, maybe mandatory ucase,
special way of assignment or leading/trailing underscore,additional trailing $...

Or would it be better to develop enumerations derived from a class that will only accept one assignment to each property
- if no destructor they would be perfect. eachh of the enumeration/classes were a unique object that can not be copied using "new" and the delaration of it would already give it a name. thinkeable also predefined (built-in) enumerations alike for the Messagebox-styles
Code: [Select]
@enum $_mbStyle_ {
{
   @var $OK=0;
   @var $OKCancel=1;
# etc.

I still have a couple of ideas but its getting to much for a first post. Anyway, happy coding you're doing great

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4402
    • View Profile
    • Multi Commander
Re: Explorerview as control to embedd or dock to an editor/window?
« Reply #1 on: April 08, 2021, 20:48:26 »
Hmm you are all over the place with many things in same post.. Next time please split them up..:)

I would like the multifunctionality of the commander implemented to customize my favourite texteditor to use it for managing all about projects using my favourite scripting language - when I see what you developed and when i look on what RJ - the developer of the texteditor - created then i think it would be win/win for all.  His "Texted" provides the environment for your scripting- and plugIn-System and even if both programs will not merge into the same window - they could dock, share the same desktop and one is for the editing and correctness in text while the other will securely will keep track on the locations where the documents are stored.

And of course it were cool to use the features like search in files to bring documents into the view and it were certainly no big deal to create syntax-highlighting and intellisense-driven autocomplete for multiscriptand if i take a look at the document viewer and look to the commanders interface i can see clearly what to develop is more fun and more important to you  ;)

Ehh That is kind of not possible. Almost entire MC in a UI Controller for embedding in another program ehh hmm sorry. that will not work. Or I dont understand what you trying to say.

And mentioning that,  i miss urgently some string functions that can work based on the count of chars and repeatedly search for matches starting from a given position again or to TrimCharsLeft or TrimCharsRight by a number that says how many to cut.

Intentionally "TrimChars" and not "String"but without a keyword  as operation that could be doable by operator signs to a string As well as AddChars
If this means left < and this means right > and this $s1 &= $s2 is regular append  $s2 to $s1 in an LTR-language  then it would be  =& in RTL/systems. Where also the characters are in opposite direction then.
    $s1<& $s2    pads   $s1 with $s2 in front, equal to $s1 = $s2 & $s1 
    $s1>& $s2   does the same as $s1 = $s1 & $s2 or s1 &= $s2
       operator   & as a symbol for concatenation
      this one /  a symbol to divide / cut /separate
 TrimCharsLeft :     $string</ $number                $s1 </ 7 truncate 7 characters on the left of $s1
 TrimCharsRight:  $string >/ $number             $s2 >/ 5 cut 5 from the right.
Sorry that will not be added, I want to keep the language simple. Not many special operators that does not existing in other languages. It is better with function calls that say what it is doing.
I want the script code to be readable. Not like pearl where you don't understand what you written after a week.

I can add special StrXXX function for different things if you have a need.

kind of a reverse operating Right$() and Left$()-functions while the Mid$() already exists - even it has only the length of 1 char but $string[4...9] were like chars "456789" : anyone instantly understands this
 $string[4(9)] says somehow we had 9 chars and start at position 4... doesnt it?
Ehh ?

Improving StrFind to StrFindNext that had 1 additional parameter to determine where to start search and return relative from starting position that were about the simple string-handling without to add more keywords.
StrFind(..) takes an offset as paramter 3 (startpos)

i also miss a way to iterate trough a string step by stepand i imagine like a "When-loop" - not really a counter-functional to "For" nor "While"  working loop that keeps repeating as long as a variable remains in a certain state and modifies a second variable as a reaction to each additional begin of iteration.
 the initial execution were to remember the value of the conditional variable and to do the operation to the second variable with the third expression not necessary math operation but appending a char. i hope this is understandeable:
When loop ?? Sorry No. no kind of loops that don't exists anywhere else. Sorry I want to keep the script language clean and easy.
I can't see the need for it, You should be able to do that with while or for.


Q: could there be global constants that are valid in all scopes of a script?
for example
Code: [Select]

@permanent -1 ->$_NOTHING_$;
a "real const" that looks different from variables, maybe mandatory ucase,
special way of assignment or leading/trailing underscore,additional trailing $...
So a readonly variable that cannot be modified.
Hmm Maybe but is there really a need for that in a simple script language like this.

Or would it be better to develop enumerations derived from a class that will only accept one assignment to each property
- if no destructor they would be perfect. eachh of the enumeration/classes were a unique object that can not be copied using "new" and the delaration of it would already give it a name. thinkeable also predefined (built-in) enumerations alike for the Messagebox-styles
Code: [Select]
@enum $_mbStyle_ {
{
   @var $OK=0;
   @var $OKCancel=1;
# etc.

I still have a couple of ideas but its getting to much for a first post. Anyway, happy coding you're doing great
hmm it is a simple script language.  Enum and stuff are nice but I don't like messing with the core script engine to add complicate stuff if it is not really needed.  the script engine code is already complicated and adding major new language stuff can break stuff.  The script engine code is one of the more complex parts in MC. So adding new core stuff in it is very time consuming. and script is not many users are actually using it, and when they are.. most script is very small and not that complex

One think I do plan to add is logical operators like  && (AND) || (OR)  ( so you can do "If( $varOne && $varTwo )" )

Adding new script functions is easy. And I'm more then happy to do that.. like more StrXX or other functions..

« Last Edit: April 08, 2021, 20:54:09 by Mathias (Author) »

ReneMiner

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Explorerview as control to embedd or dock to an editor/window?
« Reply #2 on: April 09, 2021, 21:50:26 »
OK, thanx for reply, i see the StrFind has the third parameter that i was missing,
means i probably looked at StrFindR that i did not see it.


 to stick with the forum sections purpose :small ideas:

 one of the buttons could by default show "Offline Help" and on click check if already available else create subfolder "Help" in the main folder and downloiad the pdf from your page (sorry i do not find the link right now). i think if the pc is a "multiplayer-engine", i. e. multiple users share it then the offline help, once downloaded is good enough for all users from the mainpath instead of once for every user.
If was downloaded / is available offline - the button will open the downloaded pdf and if "check for updates" in general is activated - it might as well check if the pdf with a newer date is available.

I created the button after downloading the pdf myself but i miss to have the "Show offline help" at the regular Help from Mainmenu.
 Instead of occupying a button there could be the offline-help as well working from menubar\help and ask once
"Do you want to download..." with a checkbox for "automatic update if available & automatic check if update available or check for available update the moment the help is clicked.
______________________________________________________________________________________

And one idea for the built/in Registry-Viewer-System:

Edit registry of an offline installation to fix and repair an installation that will no more boot etc.

(should require explicit user consent that he understands what he is doing)

You need him to point the windows folder of the installation (could be Windows or WinNT or whatever)
just make sure it is NOT EQUAL TO %SYSTEMROOT%,
i call the folder now "ROOTX",
give commandline/command
"fltmc volumes" and capture the output
gives you a list of available volumes and what device they are at looks alike
Code: [Select]
C:\Windows\system32>fltmc volumes
DOS-Name                        Volumename                              Dateisystem   Status
------------------------------  ---------------------------------------  ----------  --------
                                \Device\Mup                              Remote
C:                              \Device\HarddiskVolume3                  NTFS
                                \Device\NamedPipe                        NamedPipe
                                \Device\Mailslot                         Mailslot
G:                              \Device\HarddiskVolume1                  FAT
C:\Data                         \Device\HarddiskVolume4                  NTFS
X:                              \Device\HarddiskVolume6                  FAT
M:                              \Device\HarddiskVolume10                 NTFS
L:                              \Device\HarddiskVolume13                 NTFS
E:                              \Device\HarddiskVolume14                 exFAT
F:                              \Device\HarddiskVolume9                  FAT
J:                              \Device\HarddiskVolume11                 NTFS
W:                              \Device\HarddiskVolume5                  NTFS
K:                              \Device\HarddiskVolume12                 NTFS
                                \Device\HarddiskVolume8                  FAT
C:\ProgramData\Microsoft\Windows\Containers\BaseImages\someGUID-some-GUID-some-GUIDsomeGUID\BaseLayer  \Device\HarddiskVolume15                 NTFS
see c:\Data in the example is a volume mounted to folder C:\Data (only for NTFS)
Actually you can obtain if a drive/volume is located on what \Device\HarddiskVolume#
and it were not complicated (i.e. require a password to edit registry of another engine in the network) but who is firm to
act as a network admin will understand you don"t provide it
 
you will need the number where i made the #
 
then starting from user/pointed "rootX"(mostly "Windows" or "WinNT", some had "Longhorn", "$CHICAGO$" or whatever 
require to build the string "path_root" as:
"\\Device\\HarddiskVolume#\\ROOTX"
and the string "path_users" as
"\\Device\\HarddiskVolume#\\Users\\"
to find in the same folder as RootX is located
' in Users should be a subfolder named "DEFAULT"
 - if not available Users\DEFAULT the registry can not be restored/edited/fixed this way.
obtain the list of subfolders in "\users\" (omit "\users\public\" but it should be there also)
in a string-array, "users_name()" where i assume users_name(0) = "DEFAULT" and all other found users/subfolders - except public - are listed and you find additional the number of "users_count" subfolders

build values:
"\REGISTRY\USER\OFFLINE_" & users_name(0 to users_count)
and settings to it with the number # of harddiskvolume obatined above
path_users & users_name(0 to users_count) & "\\NTUSER.DAT"
together should give a line as
"\REGISTRY\USER\_OFFLINE_DEFAULT"="\\Device\\HarddiskVolume#\\Users\\Default\\NTUSER.DAT"
and one more like this for each user ,
 for example find a folder "d:\Users\John\" and D: were Hraddiskvolume7
"\REGISTRY\USER\_OFFLINE_JOHN"="\\Device\\HarddiskVolume7\\Users\\John\\NTUSER.DAT"

additionally there is needed to add values and settings:
"\REGISTRY\MACHINE\_OFFLINE_SAM"="\\Device\\HarddiskVolume#\\ROOTX\\System32\\config\\SAM"
"\REGISTRY\MACHINE\_OFFLINE_SYSTEM"="\\Device\\HarddiskVolume#\\ROOTX\\System32\\config\\SYSTEM"
"\REGISTRY\MACHINE\_OFFLINE_SECURITY"="\\Device\\HarddiskVolume#\\ROOTX\\System32\\config\\SECURITY"
"\REGISTRY\MACHINE\_OFFLINE_SOFTWARE"="\\Device\\HarddiskVolume#\\ROOTX\\System32\\config\\SOFTWARE"

now you can create *.reg-file and reg import or use function reg add and apply the values and settings to a certain key.


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist]

as soon imported/added refresh the treeview and start a thread to unmount the hives if the user does not do it before he ends the commander and you could just add negative values as for example

-"\REGISTRY\MACHINE\_OFFLINE_SOFTWARE"
or empty the settings or delete values and settings (cleanest)
should be done if the user selects another section than registry in the dropdown above the tree or when commander ends. /Safer of course if early/


 
 
« Last Edit: April 09, 2021, 22:14:44 by ReneMiner »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4402
    • View Profile
    • Multi Commander
Re: Explorerview as control to embedd or dock to an editor/window?
« Reply #3 on: April 10, 2021, 15:45:24 »
OK, thanx for reply, i see the StrFind has the third parameter that i was missing,
means i probably looked at StrFindR that i did not see it.
Do you need a StrRFind function that have offset parameter on where to start ?


one of the buttons could by default show "Offline Help" and on click check if already available else create subfolder "Help" in the main folder and downloiad the pdf from your page (sorry i do not find the link right now). i think if the pc is a "multiplayer-engine", i. e. multiple users share it then the offline help, once downloaded is good enough for all users from the mainpath instead of once for every user.
If was downloaded / is available offline - the button will open the downloaded pdf and if "check for updates" in general is activated - it might as well check if the pdf with a newer date is available.

I created the button after downloading the pdf myself but i miss to have the "Show offline help" at the regular Help from Mainmenu.
 Instead of occupying a button there could be the offline-help as well working from menubar\help and ask once
"Do you want to download..." with a checkbox for "automatic update if available & automatic check if update available or check for available update the moment the help is clicked.
There is a menu option in help that take you to the page where you can download or browse the documentation.
(And almost nobody is reading the documentation anyway ;) )


And one idea for the built/in Registry-Viewer-System:

Edit registry of an offline installation to fix and repair an installation that will no more boot etc.
Sorry. I don't understand what you are talking about.
I know you can open a registry hive file from another installation in regedit.. You want to do something like that ?

ReneMiner

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Explorerview as control to embedd or dock to an editor/window?
« Reply #4 on: April 12, 2021, 21:49:55 »
I see you have no idea what valuable tool your commander becomes in some situations.
Do you know Windows RE or WinPE?
it doesnt even provide a windows explorer and refuses after a while to execute batch scripts  or to open regedit.
I have the portable edition of the commander to access the filesystem and since it has multiscript implemented it became even more valuable because .bat or .cmd will not be executed any more...WinRE is the Windows-Recovery-Environment and everyone who uses a windows-pc  should have a rescue-system that has the commander integrated. Mounting the registry hives i could do myself using commandline. But - i mentioned it already- winRE and WinPE refuse to run anything after a few hours. But the multiscripts that are invoked by the commander still function. Thats why i sugggested it.  the commander can mount these hives and also unmount them again in a clean and safe way.

and + i am the one who downloaded the offline helop. sometimes i need it. even if its written as if noone would ever look inside and i am sure many users look inside once only, can not find what they were looking for and give up on it. Makes the built-in scriptengine become kind of dead data thats just cluttering disk space.  Then i could ask back: what for you implemented a script-engine? no one will ever use it because no one understands the manual ...

And the other thing i saw a 7z-implementation  but none of the 7z-files that i know.
Is it other names or completely recompiled? Is it just implemented to create and unpack archives?
thats kind of castration to 7z... expecially 7z.dll and 7z,exe (the commandline tool) are capable of things like disassembling iso-files / can extract files from iso/image without the need to mount it. 7z can disassemble compiled html-files (.chm, help-files) and anyway it can extract ressorces of exe & dll or rc files, it can extract files from almost any installer, cabinet, and can obtain resources and file/version/information from executeables and installer packages archives and it can split , extract, mount or unmount windows system images (wim) which makes it kind of tool that can be used when windows already refuses cooperation, the system is not ready to restart and its like : in 5 minutes i will know if i have to reinstall the whole nethood or if i ever get the current system to run again. so i will put these 2 files inzt my comander/directory to make sure 7z is available for scripting and commandline.. Are 7z.exe and 7z.dll recompiled and part of the packAGE OR NOT AVAILABLE?

 

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4402
    • View Profile
    • Multi Commander
Re: Explorerview as control to embedd or dock to an editor/window?
« Reply #5 on: April 12, 2021, 22:47:20 »
I see you have no idea what valuable tool your commander becomes in some situations.
Do you know Windows RE or WinPE?
Oh yes I know what it is. But years since I used it last.

it doesnt even provide a windows explorer and refuses after a while to execute batch scripts  or to open regedit.
I have the portable edition of the commander to access the filesystem and since it has multiscript implemented it became even more valuable because .bat or .cmd will not be executed any more...WinRE is the Windows-Recovery-Environment and everyone who uses a windows-pc  should have a rescue-system that has the commander integrated. Mounting the registry hives i could do myself using commandline. But - i mentioned it already- winRE and WinPE refuse to run anything after a few hours. But the multiscripts that are invoked by the commander still function. Thats why i sugggested it.  the commander can mount these hives and also unmount them again in a clean and safe way.
Ok so you wanted functions to mount/unmount an external registry hive. Hmm Not sure how the Windows API for that is exposed, might be easy. Might be possible to add script functions for that.

and + i am the one who downloaded the offline helop. sometimes i need it. even if its written as if noone would ever look inside and i am sure many users look inside once only, can not find what they were looking for and give up on it. Makes the built-in scriptengine become kind of dead data thats just cluttering disk space.  Then i could ask back: what for you implemented a script-engine? no one will ever use it because no one understands the manual ...
Script engine was added because I needed it, Most things in MC was added because I need it ;)

And the other thing i saw a 7z-implementation  but none of the 7z-files that i know.
Is it other names or completely recompiled? Is it just implemented to create and unpack archives?
thats kind of castration to 7z... expecially 7z.dll and 7z,exe (the commandline tool) are capable of things like disassembling iso-files / can extract files from iso/image without the need to mount it. 7z can disassemble compiled html-files (.chm, help-files) and anyway it can extract ressorces of exe & dll or rc files, it can extract files from almost any installer, cabinet, and can obtain resources and file/version/information from executeables and installer packages archives and it can split , extract, mount or unmount windows system images (wim) which makes it kind of tool that can be used when windows already refuses cooperation, the system is not ready to restart and its like : in 5 minutes i will know if i have to reinstall the whole nethood or if i ever get the current system to run again. so i will put these 2 files inzt my comander/directory to make sure 7z is available for scripting and commandline.. Are 7z.exe and 7z.dll recompiled and part of the packAGE OR NOT AVAILABLE?
You are mixing up two things 7-zip and 7z
7z is the format for the lzma/lzma2 compressed files
7-zip is their tool for 7z that also include many other formats.
MC support the 7z format.  MC cannot use everything in 7Zip and use their 7z.dll, because of license and redist issue and also their API is a messy and do not match MC.

But better support for using external packers/unpacker are planned.