Thread

VB Tip (Although it could completly obliterate your project) (Sdk)

VB Tip (Although it could completly obliterate your project) // Sdk

1  |  

strike rapier

May 23, 2002, 3:39pm
Hey folks,
Im jsut posting to make a little tip that I just used (ive been using it
for quite a while but I thought id post it for those who dont know it yet).

In Visual Basic 6 forms data are kept in a file with the extension .frm, in
my usual inquisitive frame of mind I opened the file up in a text editor and
found that all the data that was part of the form was stood there. Now this
is a tip to create multiple copies of a set of objects that are based on a
parent object (cause copy and paste sets the parent to the form (for me
anyway) which is a real pain when I need to make 5 copies of a collection of
objects with only various things changed (like a caption and the object
names).

What is good about it is that the way it is setup is by the objects parent.

Each object starts with its library then a dot, then the object identifier
name for a rich text box this would be

Begin RichTextLib.RichTextBox RTBConsole

"Begin " & Lib & "." & ObjectClass & " " & ObjectNameOnForm

Now its indent shows that its parent is the section it is in with the next
less indent. This gives a great opertunity to wipe out hours and hour and
hours and hours of remaking sets of objects...

The method is simple, simply copy and paste (including the prevailing
spaces) the set of objects you wish to duplicate from the entire parent set
(so you should have 1 big set of indented text).

Now you can just use Find and Replace to change the form names and captions
etc, for example my logging RTB's are called "RTB" & WhatItLogs and my
captions are WhatItLogs & " Logging Display" hence all I would do is use
find and replace to change WhatItLogs to the next item so it would now read
for example...

Begin RichTextLib.RichTextBox RTBTechLog

Then copy this (And for gawd sakes include the spaces before each line or ur
commiting suicide). and paste it at the end of the section you origionally
copied on the next new line (press return to get 1). You can keep doing ths
technique as many times as required. I managed to create copies of all my
data logging features in less than 5 min. Which is actually less time that
it took me to write this (I was eating a sandwich at the time.)

Hope this helps some of you :)

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn