Submitted by gregory on 2015/08/10 09:00
So, some while ago, I decided to be clever and keep most of my VBScript code as user code. This is shared between IQbases which meant that I didn't need to keep copying VBScript code whenever I started a new IQbase.

Unfortunately, at some recent point, I have lost a significant amount of my user code. Furthermore, as far as I can tell, when I seek to go back to a much older IQbase which I believe should contain that old code, I still do not see the missing code.

Three questions:
1. Where is user code stored; is it in the most recently opened IQbase? In some deep recess of the InfoQube product itself? In the registry???
2. How can I go back to some earlier version of that user code?
3. For the future, how can I safely back up the user code? Or what other strategy do you recommend?

This is a very serious problem for me. Unfortunately, I have not kept my source code elsewhere than in the product and – like all good programmers – the documentation for my code is in the code itself. Not all my code is gone; but a significant amount of more recent code has, and to rewrite it will take me considerable time. Arghhh!

Comments

Hi Mark,
 
The user code is stored in the file User.vb
 
For the portable flavor, the folder is IQFolder\Users\WinUserName
For the installable flavor, the folder is your Windows user data folder\InfoQube
 
User code file is read at startup and when opening a file. Unless you make changes using the VB Editor, it is nor read nor saved after that.
 
HTH
 
Pierre_Admin
 

gregory

2015/08/10 14:04

In reply to by Pierre_Admin

Hello Pierre.

Yes, it does help. It helps to prove that it is always very wise to backup before making significant changes…! Now that I know which folder contains the user code, I will make sure to keep it safe in the future.

I still do not know what I did to cause the loss of certain user code; I suspect it was a problem of my own creation whereby I had the same IQbase open twice, made changes to the user code and then closed the IQbase instances in the "wrong" order. Whatever the cause, the lesson is clear: make sure to keep things safe!

I note also that this probably puts into question the wisdom of keeping everything in user code. By splitting code between different IQbases, with some code in each different database, the danger of corruption or loss of the whole code base is minimised.
 
Mark GREGORY, Redon, France - GMT +1/+2; EST +6

Armando

2015/08/11 16:40

In reply to by gregory

IMO, keeping everything in the usercode is harmless (and useful since you can edit/view the content -- while  being careful -- with other editors) if your backup plan includes the IQ directory.
 
Made a few mistakes in the past with this and learned to backup the whole IQ directory like everything else. It's a good habit anyway, since you might have other customizations you'd like to recover after some disaster (icons, toolbars, keyboard shortcuts, etc.).
 
I also version control (with Git) everything I do/change in IQ's scripts.
 
-------------------------------------------------------
Windows 8.1
Sony Vaio S Series 13 (SVS131E21L)
Ram:8gb, CPU: Intel i5-3230M, 2.6ghz