Author Topic: SlimViewer, project in MasmBasic  (Read 2082 times)

LordAdef

  • Member
  • ****
  • Posts: 604
SlimViewer, project in MasmBasic
« on: January 26, 2018, 06:32:58 PM »
Hi JJ,

I´m starting this thread for that side project I told you about.

well, I managed to get a Combobox, although I have no clue of what I´m doing :dazzled:

So far, this is what I get:
   include \masm32\MasmBasic\Res\MbGui.asm
 Init
 
    Let esi=FolderOpen$()      ; no args = use Windows defaults, start with current folder
       
    ;GuiControl MyEdit, "richedit", "Go to the menu and open a file", y80+20
    
    ; ------------------- StatusBar  ------------------------
    GuiControl MySbar, "statusbar", text "MasmBasic is easy"
 
   ; ------------------- ComboBox ------------------------
      GuiControl MyLb, "combobox", y 60, h 100
      GuiControl MyEd, "static", text "Double-click to open a file ", h 50
      GetFiles esi *.as?
      ;SortFiles      ; latest files on top
      SetListbox Files$()      ; Fill the listbox with UTF-8 encoded file names
      ; SetCombobox Files$()      ; This gives me an error
      Event Command
      .if NotifyCode==LBN_DBLCLK
      ; this gives me an error
      ;uShEx LbSel$      
; open selected file with ShellExecuteW (u=assume UTF-8 for LbSel$)
      .endif
      GuiEnd
EndOfCode[/quote]

SetComboBox gives me this: "Symbol not defined : StringArrHeader.fSize"

Firstly, How do I set the windows´ size?
Secondly: if GetFiles *.as?   ; asc, asm, rc    has no full address, does it give me the file list from where my .exe is running? In case of a plugin, the folder of the current opened .asc?
Thirdly, it seems GuiControl still hasn´t got treeview implemented. Right?

BTW, MB is fun!

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8840
  • Assembler is fun ;-)
    • MasmBasic
Re: SlimViewer, project in MasmBasic
« Reply #1 on: January 26, 2018, 09:27:05 PM »
SetComboBox gives me this: "Symbol not defined : StringArrHeader.fSize"
That is a bug, thanks for finding it ;); see code below for instructions.

Quote
Firstly, How do I set the windows´ size?

GuiParas equ "Hello LordAdef", x650, y20, w200, h200, cblack, b00FFFFD0h
GuiMenu equ @File, &Open, &Save, -, E&xit, @Edit, Undo, Copy, Paste
include \masm32\MasmBasic\Res\MbGui.asm
Event Menu
  deb 1, "You clicked", MenuID
Event Message
  inc msgCount
  deb 4, "msg", chg:msgCount    ; , wParam, lParam      ; see deb
GuiEnd


Quote
Secondly: if GetFiles *.as?   ; asc, asm, rc    has no full address, does it give me the file list from where my .exe is running? In case of a plugin, the folder of the current opened .asc?
Yes. But you can construct other paths with Cat$(), see below.

Quote
Thirdly, it seems GuiControl still hasn´t got treeview implemented. Right?

BTW, MB is fun!

Thanks :biggrin:

GuiControl might work with a treeview, but I never tested it. Try GuiControl MyTree, "SysTreeview32", style TVS_HASLINES
If you don't see error messages, you have a treeview control with handle hMyTree. All the rest has to be done manually, e.g. with the TVM_INSERTITEM message.


Code: [Select]
   include \masm32\MasmBasic\Res\MbGui.asm
 ; Init ; not needed for the MbGui family
 
    Let esi=FolderOpen$()      ; no args = use Windows defaults, start with current folder
       
    ;GuiControl MyEdit, "richedit", "Go to the menu and open a file", y80+20
   
    ; ------------------- StatusBar  ------------------------
    GuiControl MySbar, "statusbar", text "MasmBasic is easy"
 
   ; ------------------- ComboBox ------------------------
      GuiControl MyLb, "combobox", y 60, h 100
      GuiControl MyEd, "static", text "Double-click to open a file ", h 50
      GetFiles Cat$(esi+"\*.as?")
      deb 4, "files found", eax ; use console output to verify what's happening!
      ;SortFiles      ; latest files on top
      ; SetListbox Files$()      ; Fill the listbox with UTF-8 encoded file names
      SetCombobox Files$()      ; This gives me an error -> in \masm32\MasmBasic\Res\MbGui.asm, change StringArrHeader.fSize to StringArrHeader.AnsiSize

      Event Command
      .if NotifyCode==CBN_SELCHANGE
    ; this gives me an error
    PrintLine "[", CbSel$, "]" ; use console output to verify what's happening!
    wShEx wRec$(CbSel$)      ; open selected file with ShellExecuteW (u=assume UTF-8 for LbSel$)
      .endif
      GuiEnd

LordAdef

  • Member
  • ****
  • Posts: 604
Re: SlimViewer, project in MasmBasic
« Reply #2 on: February 02, 2018, 04:47:26 PM »
Would you give me an example, one parent? I got a bit lost

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8840
  • Assembler is fun ;-)
    • MasmBasic
Re: SlimViewer, project in MasmBasic
« Reply #3 on: February 02, 2018, 07:21:51 PM »
Strangely enough, I have never used a TreeView before. Anyway, I got it working (project attached):

GuiParas equ "TreeView demo", x650, y20, w200, h400, cblack, b00FFFFD0h
include \masm32\MasmBasic\Res\MbGui.asm
GuiControl MyTree, "SysTreeview32", style TVS_HASLINES or TVS_SINGLEEXPAND, bcol RgbCol(255, 240, 0)
  SetGlobals tvi:TV_INSERTSTRUCT
  m2m tvi.hParent, TVI_ROOT
  mov tvi.hInsertAfter, TVI_LAST
  m2m tvi.item.imask, TVIF_TEXT
  mov tvi.item.pszText, Chr$("I am the root")
  mov tvi.hParent, rv(SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi)

  For_ ct=1 To 29
        mov tvi.item.pszText, Str$("This is line %i", ct)
        invoke SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi
  Next
GuiEnd


To see the nodes, double-click on "I am the root".

LordAdef

  • Member
  • ****
  • Posts: 604
Re: SlimViewer, project in MasmBasic
« Reply #4 on: February 03, 2018, 02:37:47 AM »
I cannot build you example. Error in line #3.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8840
  • Assembler is fun ;-)
    • MasmBasic
Re: SlimViewer, project in MasmBasic
« Reply #5 on: February 03, 2018, 03:26:52 AM »
Comment out ; bcol... (the background colour doesn't work anyway with this control)

LordAdef

  • Member
  • ****
  • Posts: 604
Re: SlimViewer, project in MasmBasic
« Reply #6 on: February 03, 2018, 01:19:29 PM »
Yes, thanks!

So, code:
Code: [Select]

 
  ; --------------------------------------------------------------------------------------------------------------------------
;                                                      Window / Menu  / StatusBar
; --------------------------------------------------------------------------------------------------------------------------
  GuiParas equ "SlimViewer", x650, y20, w800, h900, cblack,  b 0EEEFFFh ; Last item == Bk colour
GuiMenu equ @File, &Open, &Save, -, E&xit, @Edit, Undo, Copy, Paste
include \masm32\MasmBasic\Res\MbGui.asm ; It MUST go after GuiMenu. WHY JJ??
GuiControl MySbar, "statusbar", text "MasmBasic is easy"

    ; --------------------------------------------------------------------------------------------------------------------------
;                                                        ComboBox
; --------------------------------------------------------------------------------------------------------------------------
  Let esi=FolderOpen$()
 
  GuiControl MyEd, "static", x 5, y 55, h 24, w200, text "Select a file: " ; Label
  GuiControl MyLb, "combobox", x 5, y 80, h 500, w 300 ; no args = use Win defaults, start with current folder
GetFiles Cat$ ("\*.as?")    ; (esi+"\*.as?") for full path
deb 4, "files found", eax ; use console output to verify what's happening!
SortFiles      ; latest files on top
SetCombobox Files$()     
; --------------------------------------------------------------------------------------------------------------------------
;                                                        TreeView
; --------------------------------------------------------------------------------------------------------------------------

GuiParas  equ "TreeView demo", x 70, y 0, w 55, h100, cblack,  b 0EEEEEEh   ;;<== IS THIS DOING ANYTHING ???
GuiControl MyTree, "SysTreeview32", x 5 , y 120, w 300 , h 880 ,  style  WS_BORDER or TVS_SINGLEEXPAND or TVS_LINESATROOT or TVS_HASBUTTONS or TVS_HASLINES or TVS_FULLROWSELECT

SetGlobals tvi:TV_INSERTSTRUCT

;  Root Procedure :
m2m tvi.hParent, TVI_ROOT
mov tvi.hInsertAfter, TVI_LAST
m2m tvi.item.imask, TVIF_TEXT
mov tvi.item.pszText, Chr$("Procedures")
mov tvi.hParent, rv(SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi)

For_ ct=1 To 29
mov tvi.item.pszText, Str$("proc %i", ct)
invoke SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi
Next

; Root Macros :
m2m tvi.hParent, TVI_ROOT
mov tvi.hInsertAfter, TVI_LAST
m2m tvi.item.imask, TVIF_TEXT
mov tvi.item.pszText, Chr$("Macros")
mov tvi.hParent, rv(SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi)

For_ ct=1 To 29
mov tvi.item.pszText, Str$("macros %i", ct)
invoke SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi
Next
; --------------------------------------------------------------------------------------------------------------------------
;                                                       RichEdit
; --------------------------------------------------------------------------------------------------------------------------
  GuiControl Overview, "richedit", x 310, y 120, h880, w490


; --------------------------------------------------------------------------------------------------------------------------
;                                                        Events
; --------------------------------------------------------------------------------------------------------------------------

Event Menu
deb 1, "You clicked", MenuID
Event Message
inc msgCount
deb 4, "msg", chg:msgCount    ; , wParam, lParam      ; see deb
Event Command
    .if NotifyCode==CBN_SELCHANGE
    PrintLine "[", CbSel$, "]" ; use console output to verify what's happening!
    wShEx wRec$(CbSel$)      ; open selected file with ShellExecuteW (u=assume UTF-8 for LbSel$)
    .endif
GuiEnd
EndOfCode

1. Why include \masm32\MasmBasic\Res\MbGui.asm must go after GuiMenu and What things wont work preceding the include (it took me a while to figure this was the reason the Menu wasn´t showing up).

2. This line doesn´t seem to be doing anything:  GuiParas  equ "TreeView demo", x 70, y 0, w 55, h100, cblack,  b 0EEEEEEh
    Only when I moved x y h w coord into Gui TreView, it worked


Don´t curse at me JJ, this is a crash course for MasmBasic Noobs! It will serve for others too   :greenclp: :bgrin::eusa_dance:
« Last Edit: February 03, 2018, 03:47:32 PM by LordAdef »

LordAdef

  • Member
  • ****
  • Posts: 604
Re: SlimViewer, project in MasmBasic
« Reply #7 on: February 03, 2018, 04:14:50 PM »
Next step is to search for proc names within the selected file.

I saw many possible instructions: FileRead$, FileOpen$, Open.  Seek,  ArraySearch and Trim looked useful.
What´s the best MB way of doing this?

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8840
  • Assembler is fun ;-)
    • MasmBasic
Re: SlimViewer, project in MasmBasic
« Reply #8 on: February 03, 2018, 08:15:39 PM »
1. Why include \masm32\MasmBasic\Res\MbGui.asm must go after GuiMenu and What things wont work preceding the include (it took me a while to figure this was the reason the Menu wasn´t showing up).

The GuiParas and GuiMenu lines must come before the include simply because the internal WinMain proc must know what are the required settings. The include does its initialisation stuff then, and directly after you are right in the WM_CREATE handler, with GuiControl ... and similar.

Quote
2. This line doesn´t seem to be doing anything:  GuiParas  equ "TreeView demo", x 70, y 0, w 55, h100, cblack,  b 0EEEEEEh
The GuiParas equate appears once before the include line. If it comes after that line, it will be ignored.

Quote
Don´t curse at me JJ, this is a crash course for MasmBasic Noobs! It will serve for others too   :greenclp: :bgrin::eusa_dance:
;)

Next step is to search for proc names within the selected file.

I saw many possible instructions: FileRead$, FileOpen$, Open.  Seek,  ArraySearch and Trim looked useful.
What´s the best MB way of doing this?
Let esi=FileRead$(filename) gives you a fat buffer with file content. No need for Open or Seek then.
FileOpen$ gives you the dialog, not what you want here I suppose.
ArraySearch is a very specialised binary search; what you need here is Instr_(src, pattern, mode).

Take a look at Recall. Since you need to find things like MyTest proc args, your needs are more line-oriented:
Code: [Select]
Recall "thefile.txt", L$()
For_ ct=0 to L$(?)-1
  Let esi=L$(ct)
  .if Instr_(esi, "proc", 5)  ; mode 5: 1=case-insensitive, 4=full word
     PrintLine esi, " contains a proc"
     push esi
     ; from here on, you may need some "real" assembler examining esi ;-)
     pop esi
  .endif
Next

Note that Let esi=L$(ct) in a loop is legal code but you are responsible that esi is unchanged when you use Let esi= again in the next iteration, therefore the push esi/pop esi sequence.

LordAdef

  • Member
  • ****
  • Posts: 604
Re: SlimViewer, project in MasmBasic
« Reply #9 on: February 04, 2018, 08:43:04 AM »
So,

"For_ ct= 0 to lineMax -1"  gives "Error A2209: Count must be positive or zero"

I added the following lines:

Code: [Select]
SetGlobals lineMax:DWORD
mov lineMax, eax ; Min(eax, 20)  **** Number of lines ret in eax ****
                Print Str$("%i lines found in File ", lineMax)
to make sure Recall was getting it right. It was.

1. What´s happening JJ?

2. Can you set a variable without declaring it ? I used SetGlobals."Let lineMax = eax" is wrong too

3. We don´t need Init or include Masmbasic when using MBGui.asm, right? (I do know this one, but it´s good for the tutorial)

Code: [Select]
    ; --------------------------------------------------------------------------------------------------------------------------
;                                                        .... RECALL ....
; --------------------------------------------------------------------------------------------------------------------------

Recall "\masm32\AFprojs\__slimViewer\template.asc", L$()    ; Hard coded to test the functions


SetGlobals lineMax:DWORD
mov lineMax, eax ; Min(eax, 20)
                  Print Str$("%i lines found in File ", lineMax)
                   
For_ ct= 0 to lineMax -1
Let esi=L$(ct)
.if Instr_(esi, "proc", 5)  ; mode 5: 1=case-insensitive, 4=full word
  PrintLine esi, " contains a proc"
   push esi
;;  from here on, you may need some "real" assembler examining esi ;-)
   pop esi
.endif
Next


jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8840
  • Assembler is fun ;-)
    • MasmBasic
Re: SlimViewer, project in MasmBasic
« Reply #10 on: February 04, 2018, 09:49:40 AM »
"For_ ct= 0 to lineMax -1"  gives "Error A2209: Count must be positive or zero"
Check if lineMax is defined.

Quote
2. Can you set a variable without declaring it ? I used SetGlobals."Let lineMax = eax" is wrong too
Normally not, but For_ ct=0 To whatever is an exception: no need to declare ct (but a REAL8 counter must be declared).
Let lineMax=eax won't work because Let is only for strings. Use mov lineMax, eax

Quote
3. We don´t need Init or include Masmbasic when using MBGui.asm, right?
Correct, the Init is done internally. Here is full code with the right order of SetGlobals and Recall:

include \masm32\MasmBasic\Res\MbGui.asm
  Recall "\Masm32\include\Windows.inc", L$()
  SetGlobals lineMax
  deb 4, "lines", eax
  mov lineMax, eax
  deb 4, "lines", lineMax
  For_ ecx=0 To Min(20, lineMax-1)
        PrintLine L$(ecx)
  Next

Event Key
  deb 1, "You pressed", VKey
GuiEnd

LordAdef

  • Member
  • ****
  • Posts: 604
Re: SlimViewer, project in MasmBasic
« Reply #11 on: February 04, 2018, 03:49:54 PM »
Ok,

I´m using "endp" to fetch my procedure names. For now I don´t care if I´m getting false positives. All I want is a draft with functionality.

Code: [Select]
Recall "\masm32\AFprojs\__slimViewer\Text.asm", L$() ; Hard coded only to test the instructions
mov lineMax, eax ; Min(eax, 20)
For_ ct= 0 To lineMax    ; Min(1000, lineMax-1)   ;
Let esi=L$(ct)

.if Instr_(esi, "endp", 5)  ; mode 5: 1=case-insensitive, 4=full word
; returns relative pos in edx, absolute in eax
sub edx, 2 ; " e"(ndp)
mov eax, z$(Left$(esi, edx))
; PrintLine Left$(esi, edx)
deb 4, "¨", $eax
push esi
mov tvi.item.pszText, Chr$(byte ptr [eax])
invoke SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi
pop esi
.endif
Next

- Instr_ returns me the relative position of "endp" in edx. Cool. 
- I "sub edx, 2" to get rid of " e"(from " endp") and what´s left is my proc name
- which can be saved into eax with this:   mov eax, z$(Left$(esi, edx))    
- deb 4, "¨", $eax  outputs all my target names!

- eax has it. I can insert the first byte of each procedure name: mov tvi.item.pszText, Chr$(byte ptr [eax])

I could easily get the full name with asm. But the idea is to be as MB as possible. So, how can I retrieve the whole string (pointed by eax)?



jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8840
  • Assembler is fun ;-)
    • MasmBasic
Re: SlimViewer, project in MasmBasic
« Reply #12 on: February 04, 2018, 07:41:03 PM »
Your code works fine, Alex. A few remarks, as shown below:
- on entry into a For_ loop, you can use whatever register, including eax;
- instead of Let esi=L$(ct), you can use mov esi, L$(ct), thus avoiding to heapalloc an extra string. However, esi should be treated as a read-only pointer.
- Instr_() returns both the index in edx, and a pointer to the match in eax. In your case, the pointer is easier to use, see below.

include \masm32\MasmBasic\Res\MbGui.asm
  SetGlobals lineMax, tvi:TV_INSERTSTRUCT
  Recall "Whatever.asm", L$()     ; change
  mov lineMax, eax
  deb 4, "lines", lineMax
  For_ ecx=0 To eax-1           ; instead of lineMax, you can use eax
        mov esi, L$(ecx)
        .if Instr_(esi, "endp", 1+4)    ; case-insensitive, full word
                .Repeat
                        dec eax
                .Until byte ptr [eax]>="0"      ; find the tail of sometest<whitespace>endp
                mov edx, eax
                .Repeat
                        dec eax
                .Until byte ptr [eax-1]<=32     ; find the start of  CrLf<whitespace>sometest endp
                sub edx, eax     ; tail-start=#bytes
                inc edx
                mov tvi.item.pszText, z$(Left$(eax, edx))
                PrintLine "[", eax, "]"  ; replace with SendMessage, ...
        .endif
  Next

Event Timer    ; at least one event is needed
  Print "."
GuiEnd


 8)

LordAdef

  • Member
  • ****
  • Posts: 604
Re: SlimViewer, project in MasmBasic
« Reply #13 on: February 05, 2018, 07:22:18 AM »
Nice Johen.
I made a small change in your code: For_ ecx ...  ecx gives error. I PUSHED and used edi instead and it worked fine
I filled the 3 Parents just for fun (it IS fun!). See the zip.
For that reason lineMax is good, for I can retrieve back into eax, for every parent feeding

Quote
                                                   PUSH edi
                                                   mov eax, lineMax
                                                 For_ edi=0 To eax-1           ; instead of lineMax, you can use eax
                                                     mov esi, L$(edi)
                                                      .if Instr_(esi, "equ", 1+4)    ; case-insensitive, full word
                                                               deb 4, "¨", eax
                                                             .Repeat
                                                                      dec eax
                                                              .Until byte ptr [eax]>="0"      ; find the tail of sometest<whitespace>endp
                                                             mov edx, eax
                                                              .Repeat
                                                                      dec eax
                                                              .Until byte ptr [eax-1]<=32    ; find the start of  CrLf<whitespace>sometest endp
                                                             sub edx, eax    ; tail-start=#bytes
                                                             inc edx
                                                             
                                                              PUSH esi
                                                             mov tvi.item.pszText, z$(Left$(eax, edx))
                                                              invoke SendMessage, hMyTree, TVM_INSERTITEM, 0, addr tvi
                                                          ;  PrintLine "[", eax, "]" ; replace with SendMessage, ...
                                                            POP esi
                                                      .endif
                                                Next
                                                POP edi

For the tutorial sake, here are the following questions and remarks I believe are relevant at this point:

1. It´s possible to create your own .data segment. I placed mine right below  "include \masm32\MasmBasic\Res\MbGui.asm" and it all seemed to be ok.
    Using the lineMax variable as an example, what would you choose: SetGlobals vs .data?

Quote
         include \masm32\MasmBasic\Res\MbGui.asm                        ; It MUST go after GuiMenu. WHY JJ??

 .data?
   lineMax      dd  ?
 .code 
        ;SetGlobals lineMax:DWORD
        GuiControl Status, "statusbar", text "MasmBasic is easy"
  Still on this topic, You wrote this: SetGlobals lineMax, tvi:TV_INSERTSTRUCT
   lineMax has no size. Does MB assumes it´s a dword?

2. Recall "\masm32\AFprojs\__slimViewer\Text.asm", L$()
       Is L$() a Global?
       How do we release the Recall (or close the file, free the memory, whatever is under the hood)?
       Say we want to Recall another file, Can we use L$ and overwrite the data in there?
3. Why MbGui.asm has MasmBasic inside and not the other way around?
4. Do you have plans on expanding GuiControls?
5. I forgot about this one: z$. It´s a porweful and useful one, but no reference in the help, Would explain it for us?

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8840
  • Assembler is fun ;-)
    • MasmBasic
Re: SlimViewer, project in MasmBasic
« Reply #14 on: February 05, 2018, 08:51:31 AM »
I made a small change in your code: For_ ecx ...  ecx gives error.
MB protects ecx, but any WinApi call will trash it. So
Code: [Select]
push ecx
invoke SendMessage, ...
pop ecx
is one option. Or use For_ ct=..., i.e. a global counter.

Quote
For the tutorial sake, here are the following questions and remarks I believe are relevant at this point:
1. It´s possible to create your own .data segment. I placed mine right below  "include \masm32\MasmBasic\Res\MbGui.asm" and it all seemed to be ok.
    Using the lineMax variable as an example, what would you choose: SetGlobals vs .data?
The best option is to use local variables, but if that is not possible:
- SetGlobals is easy to declare and uses the .data? section for frequently used variables with short encodings of the form
mov eax, [ebx+n]. Advantage: compact code. Disadvantage: under the hood, it needs ebx as an index register, so ebx is not available for other things unless you push+pop it.
- "Real" global variables have longer encodings, 5 bytes instead of 3. Good for rarely used variables that must be globally available.

Quote
include \masm32\MasmBasic\Res\MbGui.asm MUST go after GuiMenu. WHY JJ??
GuiParas and GuiMenu are equates that are being used by MbGui.asm. So they must be defined before the include.

Quote
Still on this topic, You wrote this: SetGlobals lineMax, tvi:TV_INSERTSTRUCT
lineMax has no size. Does MB assumes it´s a dword?
Yes, exactly, but it's not MB-specific. Masm does the same for local variables and args of a proc.

Quote
2. Recall "\masm32\AFprojs\__slimViewer\Text.asm", L$()
       Is L$() a Global?
When using Recall "some.txt", some$(), you get an array of strings, and arrays are always global.

Quote
How do we release the Recall (or close the file, free the memory, whatever is under the hood)?
No need to release it. If you are short of memory, you may use Erase$ some$(), but normally it's not needed.

Quote
Say we want to Recall another file, Can we use L$ and overwrite the data in there?
Yes, the old array gets automatically heapfree'd, and a new one with the same name gets created.

Quote
3. Why MbGui.asm has MasmBasic inside and not the other way around?
4. Do you have plans on expanding GuiControls?
3. MbGui is newer and relies on the full MB library.
4. In principle, GuiControls should already work with all kind of controls, but some are special. Right now I am working on a spreadsheet/table/grid control (the name is not yet decided).

Quote
5. I forgot about this one: z$. It´s a porweful and useful one, but no reference in the help, Would explain it for us?
For Print and Let, MB uses an internal buffer for short strings, which allows e.g.
Code: [Select]
Let esi="Hello, now it's "+fTime$(0)+" on "+fDate$(0, "dd MMM yy")The Let and Print macros have access to the internal structure that registers the order of the strings etc, and can thus produce compact and powerful code.
In rare occasions, you may want a direct pointer, example:
Code: [Select]
  mov eax, z$(Left$("abcde", 3))
  PrintLine eax
I haven't used z() for years, though. Be careful, check if it really works, and use Olly if in doubt. There is a reason why it is not documented; my advice: Use Cat$() instead, it's safer.