Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Extended RPC Open Script with file versioning

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Extended RPC Open Script with file versioning
#11785
Posted by: PeterJ 2007-09-10 02:33:23 Last edited by: PeterJ 2007-09-11 12:51:43 (Total edited 4 times)
Attached is a OpenRex script. It allows to open rexx files via a recent file list, or the contents of the current reginald directory.
1. The recent list is maintained with every open.
2. Additionally a version of the opened rex is saved to allow a recovery.

The versions are suffixed with the extension '.Vnn' nn may be a number from 0 to 99. 0 means the most recent version, 1 means the version before the most recent, 2 ...

It may help in recovering old versions, caused by editing errors.
OpenRex.rex
Message2. How are you supposed to use it Peter ?
#11794
Posted by: Michael S 2007-09-11 03:00:16
Am I supposed to add it as a macro to RPC or ???
Message3.
#11800
Posted by: PeterJ 2007-09-11 12:28:37
you are right, it was possibly to obvious to me! I also added it to the toolbar and moved the icon to the left.
Message4. Another question
#11801
Posted by: Michael S 2007-09-11 14:24:09
I've done the 2 things you mentioned, but looking at the code

regdir=VALUE('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\RxLaunch.exe\Path', ,"WIN32")

I don't have an "App Paths" at work or at home. What OS are you running ?

Then , unless it's totally obvious, how do I use the script ?
Message5.
#11804
Posted by: PeterJ 2007-09-11 15:24:12 Last edited by: PeterJ 2007-09-11 15:26:09 (Total edited 1 time)
I run Windows XP Professional. The registry entry, shows the current Reginald directory. That you don't have it confuses me, possibly Jeff
can comment on it.
For the time being you can replace it by hard coding the regdir variable to your Reginald directory.

Usage of OpenRex:

What you see is a window with 2 list boxes:
1. listbox contains your recently opened REXX files (1. time empty of course)
2. listbox contains the contents of your current Reginald directory

to open an entry you either:
1. double click on an item (1. or 2. listbox) then it gets opened
2. you select an item (1. or 2. listbox) and press the OPEN button
3. you press the other file button and select it from a GUIFILE dialog

Processes which take place:
1. the selected file from above is opened

2. The file selection maintains the Recent Files List (you will see it the next time you open the dialog)

3. The version you open is saved in rex-name.REX.V00 .
If rex-name.REX.V00 and all other versions are pushed back in rex-name.REX.V01, rex-name.REX.V02, etc. For recovery purposes. Any recovery from previous versionns must be done manually, I didn't yet think of an application.

Other Buttons:

CLEAR  : clears the Recent File List completely
REDUCE: reduces the List to the most recent 10

CANCEL: terminates the dialog

Any suggestions are appreciated!
Currently I think of the follow extensions:
- allow multiple open of several files
- add a favourite list, containing files you frequently modify.
Message6. Hmmm, if you don't
#11805
Posted by: Michael S 2007-09-11 16:12:56 Last edited by: Michael S 2007-09-11 16:14:35 (Total edited 1 time)
look in the correct place, then you can't find it. Mea culpa
Message7. Okay - got it working now
#11806
Posted by: Michael S 2007-09-11 16:26:26
My first comment.

I never keep my scripts in the same directory as Reginald for 2 reasons. Here at work, no backup is ever done on the C-drive, so I do all my work on a network drive (that is backed up).

A simple suggestion - allow the user to customize so it picks up the starting directory of their choice - maybe put this path in a simple file. If the code finds it, use it, otherwise use the default rxlaunch directory as you already do.

Secondly, pick up the RPC backup directory and place all the version backups there instead (rather than cluttering up the base development directory). At the end of the day, the version scripts are only required when something's gone seriously wrong and you want to get back to a starting point.
Message8.
#11809
Posted by: PeterJ 2007-09-12 01:53:02
thanks Michael. I added the suggested source directory customisation (Options Menu), by default it's the Reginald directory, additionally you can define the backup directory. In the very first call you are prompted for it in a directory dialog, then it's using the saved registry entry.

There are now also multiple selects (opens) possible.
OpenRex.rex
Message9. Looking much better (from my point of view)
#11811
Posted by: Michael S 2007-09-12 04:45:33
now all it needs is a sexy icon for the toolbar  !-)
Message10.
#11814
Posted by: PeterJ 2007-09-12 12:20:36
how to do that?
Message11. Tell you what ..
#11815
Posted by: Michael S 2007-09-12 16:47:55
I'll let Jeff answer the how and YOU design the icon (I'll just sit back and wait for the result !-) )
Message12.
#11818
Posted by: PeterJ 2007-09-12 18:28:34
no, no my question is: how can you tailor the tool button to use a different icon. I didn't find a way.
Message13. I understood your question,
#11819
Posted by: Michael S 2007-09-12 19:01:15
thereof my throwing the responsibility for the question to Jeff
Message14.
#11827
Posted by: mestrini 2007-09-13 21:14:29
This thread is getting amusing by the day :D
Message15. Another suggestion for an improvement
#11843
Posted by: Michael S 2007-09-14 17:23:36
When I've set up the app, I see the recently used scripts in the left pane and a list of all the scripts in my starting directory in the right pane.

In reality, I might want to open a script that I'd been working on yesterday, but can't remember its exact name (so I don't want to have to scroll through the right pane looking for it).

As a result, I click on the Other file button, select details, sort on descending date order and pick the script. Trouble is, files chosen that way don't seem to get added to the left pane.

My suggestion is either to do so, or include some method of sorting the right pane in a specified order. Maybe as one of the options would be good (saved between sessions). Often, if my script isn't in the RPC recently used list, I do exactly what I described in the third paragraph.
Message16.
#11844
Posted by: PeterJ 2007-09-14 17:59:05
if you use "other File" to open a script, it is added to the left pane! I verified it right now, it becomes the first entry : left pane.

for the right pane, I really would like to display a normal fire/directory screen, with all the different viewing and sorting functions. Currently I use a  simple
guisendmsg("RegFiles", "DIR", , directory...)

what would be awesome is to catch GUFILE display and lock it in the right pane.

Please verify the "other File" problem.
Message17. Well, where the hell did I think that
#11845
Posted by: Michael S 2007-09-14 18:50:03 Last edited by: Michael S 2007-09-14 21:22:27 (Total edited 1 time)
As you say, select a file via Other file and it is shown in the left pane. Sorry about that.

As to capturing the results of the GUIFILE, I have an idea but it'll take a while. I'll get back to you

Okay -done. Send me a note to misi012004 at the usual yahoo address and I'll send the updated code
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥1,360.00 ·
 
 
¥271.00 ·
 
 
¥880.00 ·
 
 
¥980.00 ·
 
 
¥890.00 编辑
 
 
¥918.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0