Code Red > VB(A)

VBA - How do you maintain your code?

(1/2) > >>

Grrr1337:
Hello guys,
This is a newbie'ish question from a lisper (me) regardless maintaining your code in VBA:

As some of you know - in LISP its very simple, you just use a text editor to write and edit your code, then a few months/years might pass and you still can reopen that .lsp file and improve or modify it. Ofcourse optional would be to comple a .vlx file and keep the .lsp file for further improvements.

But now I'm trying to getting started with VBA and this issue is the first drawback for me:
Obviously you create few modules/userforms and write some codes inside, then save the whole project as .dvb file (ctrl+s).
After that you close AutoCAD and start a new session again, deciding to reopen the project you previously wrote, but the only way I found is to try importing the .dvb file so I'm ending up with a compiled s*it...

So whats the proper way to maintain VBA projects (codes) ?

Lee Mac:
I tend to export to BASIC (.bas) files, which are text format.

MP:
If you reference the runtime for Visual Basic Applications Extensibility (I'm posting from my phone - so it may not be named exactly that - but should be close) you can write code to iterate over all projects and code panes etc and export the code to .bas and .cls files as applicable. I do this for excel especially -- every time I press {ctr}{b} it creates a dated folder hierarchy with exported code. O.o

Grrr1337:

--- Quote from: Lee Mac on September 21, 2017, 06:55:16 PM ---I tend to export to BASIC (.bas) files, which are text format.

--- End quote ---

I just noticed that one could export a single module/userform, Thanks Lee!



--- Quote from: MP on September 21, 2017, 07:13:56 PM ---If you reference the runtime for Visual Basic Applications Extensibility (I'm posting from my phone - so it may not be named exactly that - but should be close) you can write code to iterate over all projects and code panes etc and export the code to .bas and .cls files as applicable. I do this for excel especially -- every time I press {ctr}{b} it creates a dated folder hierarchy with exported code. O.o

--- End quote ---

Umm.. I see, so a functions to export/import the project hierarchy are required (I thought such options have to be built-in already <duh>).
Thanks, Michael! [BTW tablet might be more comfortable for writing] :)


Guess I'll stick to scripting objects by using lisp for a while, and use the VBAIDE editor (aswell some internet VBA codes) to guide me thru my object-scripting tasks.
I just hope that bit by bit I'll get used with VBA (although my recent problems are lisp solvable) so that was my first VBA struggle.

BIGAL:
Dont forget you can make big VBA code with lots of functions so you only have 1 code version yes you can do same in lisps also. Your forms re DCL are saved in the file as well, not to mention the forms are interactive rather than write code and test.

Nice thing is you can group your code under a heading for a common theme and jump to just that group of code. Where as in lisp you would have to say scroll down to the top defun level to see all the functions in that group.

Lee can you do this in VLIDE?

Navigation

[0] Message Index

[#] Next page

Go to full version