|
Post by Roger Cabo on Jul 7, 2023 20:11:45 GMT 1
Hi,
I never created a lib in gb32... shame on me.. Is there a small example how to create my own command like: PHP_ScriptExtractor()
// This I would do in gb32.. Dim A$() PHP_ScriptExtractor(a$(), int1% , stringly$, anytype())
Type anyType intx As Integer inty As Integer ints As String*50 EndType
Global anyType(0) As anyType
Function PHP_ScriptExtractor(ByRef a$(), int1%, stringly$, ByRef mytype() As anyType) As Bool Naked ... EndFunction
Are there any restrictions I should generally take care about? Further I would love to have my own MessageBox with the form, and would that work as well? I like to display all chars from 0 to 255 in my MessageBox. And the special chars as Dec tokens, not Hex. Thank you..
|
|
|
Post by dragonjim on Jul 7, 2023 20:35:05 GMT 1
How to create LG32 libraries and most of the limitations are covered in the English help file.
Generally you can not use Data/Read constructs, you need to be careful using Global variables and you can not handle OCX Events directly inside a library...and there is more.
Also, to make a library, simply put an $Export line containing the function(s) you want to be usable by other programs.
It is covered in more detail within the help file, however.
|
|
|
Post by Roger Cabo on Jul 7, 2023 21:02:26 GMT 1
How to create LG32 libraries and most of the limitations are covered in the English help file. handle OCX Events directly inside a library...and there is more. Also, to make a library, simply put an $Export line containing the function(s) you want to be usable by other programs. It is covered in more detail within the help file, however. Would it possible to load a library inside a library ?
|
|
|
Post by dragonjim on Jul 7, 2023 21:07:09 GMT 1
Yes, it is possible to do s, although you need to ensure there are no name conflicts.
Most of the time it works fine, but, sometimes, it doesn't and there may not a logical reason why not.
|
|
|
Post by dragonjim on Jul 7, 2023 21:08:27 GMT 1
Oh yes, and remember that all functions you want to be available need to be exported, including those within the library inside the library.
|
|
|
Post by (X) on Jul 7, 2023 23:44:18 GMT 1
I encourage you Roger. I was hesitant at first to try to create a GFA-BASIC 32 library or .lg32 file. I am glad I did. I think you will turn to making more and more libraries as you go along. As dragonjim says there are limitations and hoops to jump through before you can get them working but it is worth the effort. * The App key is the one that looks like a mouse cursor on a menu drop-down. Hold down App and press 2 and you should load the next program in the recent used program list.
|
|
|
Post by dragonjim on Jul 8, 2023 19:57:10 GMT 1
Nice tip. Is that something you have posted before?
I think it is worth adding to the help file.
|
|
|
Post by (X) on Jul 9, 2023 1:01:08 GMT 1
I think it was something that was part of a GLL 'GFA Helper Shortcuts Demo' from a long time ago (in a galaxy far far away...).
Sub Gfa_App_1 ' Load MRU file #1 (Key just before right control key) ' ' Load specified Most Recently Used file in the MRU list... ' ' ' First, save this file if has been changed i.e.: Dirty... ' If Gfa_Dirty Then Gfa_Save ' ' Load the # 1 file in the MRU list... ' Gfa_LoadMRU 1 EndSub
Sub Gfa_App_2 ' Load MRU file #2 ' ' Load specified Most Recently Used file in the MRU list... ' ' ' First, save this file if has been changed i.e.: Dirty... ' If Gfa_Dirty Then Gfa_Save ' ' Load the # 2 file in the MRU list... ' Gfa_LoadMRU 2 EndSub
|
|
|
Post by Roger Cabo on Jul 9, 2023 12:19:22 GMT 1
I split my screen vertically into 2 parts. left, org code and right anything to compare with. Using a 42" 16:9 left windows or right window click && F5.
Don't know if gb32 pre cache the loaded libs into ram, but i think not.
|
|
|
Post by dragonjim on Jul 9, 2023 12:31:52 GMT 1
Gb32 loads the library either when the program is opened or the $Library line is added to the listing. I haven't tried removing the $Library line and then adding it again. That may work. Otherwise, you have to close and then reopen the calling program to reload the Library.
|
|