Library help
#1
Anyone know where I can find a cute librarian? Oops, wrong forum...

I'm finding I'd like to have several shorter libraries, rather than combined functions made into a single libraries. For example, I can have a single gui library that creates a form, allows user selection and input, and produces menus, or...

I can have...

Keyboard / Mouse library
Menu library
Form library
Input Text library

What's cool is each of the above could be ported to other apps.

So here's my options...

1) Each library loads the DIM SHARD statements into the main.

2) I have to pass all variables from every library I create, regardless if libraries I include in my app only use some of those variables and arrays.

Frankly I'm leaning towards option 1. To get around naming issues, I'd go with naming the variables in relation to the library they are best associated with like MyMenuChoices$, etc.

What do you guys think or do?

Pete
Reply
#2
I would say it depends how much one library shares code or shared variables with another also how much code is actually relevant to the combined project.

I would probably combine 4 to 1 in both Bi and BM just to be assured they will play nice together without redundancy and be rid of the irrelevant.

If all 4 were completely independent, nothing shared, it would be easy to just include the 4 sets specially if all or most were relevant to the app.
b = b + ...
Reply
#3
That's the thing. N0 real 'master plan' as of yet, so I'm thinking I need the versatility, which is my option #1.

Pete
Reply
#4
I like the idea of each piece being separate enough to be able to be included in anything else without being dependent on any of the others. I sometimes use shared variables but I do my best to steer clear of them. They're very necessary, though, in certain cases.
Ask me about Windows API and maybe some Linux stuff
Reply
#5
Yes, I'd love it if there were no variable dependencies, but take for instance a mouse and keyboard library. All modules that call it will be dependent on the variables of position, click event, key press, etc. Actually, I think just about every complex app I've ever coded had multiple variable dependencies. In the early days of multi-modular programming, I used a lot of COMMON SHARED to deal with those situations.

Pete
If eggs are brain food, Biden takes his scrambled.
Reply
#6
(12-21-2022, 08:22 PM)Pete Wrote: Anyone know where I can find a cute librarian? 
Pete

Of coures!  Tongue

Librarian
Reply
#7
It'd be cool if you were able to use QB64pe to make DLLs without some weird hacky way.
Ask me about Windows API and maybe some Linux stuff
Reply
#8
Funny, I used to say exactly the same thing about QuickBASIC. I did hack my way around that. Also, it turned out QuickBASIC would execute a RUN "my.dll" exactly the same as it would an exe.

Pete
If eggs are brain food, Biden takes his scrambled.
Reply
#9
(12-21-2022, 10:10 PM)Kernelpanic Wrote:
(12-21-2022, 08:22 PM)Pete Wrote: Anyone know where I can find a cute librarian? 
Pete

Of coures!  Tongue

Librarian

What? She has books in front of her stack. DO BETTER!

Pete Big Grin
If eggs are brain food, Biden takes his scrambled.
Reply
#10
Wait, this was wrong here! 

[Image: oops1.gif]
Reply




Users browsing this thread: 2 Guest(s)