|
Post by Walt Decker on Dec 2, 2020 17:24:15 GMT -5
There appears to be a problem in the editor/debugger. This code:
A = WS.OVERLAPPED OR WS.POPUP OR WS.VISIBLE OR WS.CLIPSIBLINGS OR WS.CLIPCHILDREN' _ A = A OR WS.CAPTION OR WS.BORDER WS.DLGFRAME OR WS.VSCROLL OR WS.HSCROLL OR WS.SYSMENU 'OR _
produces a syntax error while this code:
WS.OVERLAPPEDWINDOW = (WS.OVERLAPPED _ OR WS.CAPTION _ OR WS.SYSMENU _ OR WS.THICKFRAME _ OR WS.MINIMIZEBOX _ OR WS.MAXIMIZEBOX)
does not.
PS: Preview does not seem to work
|
|
|
Post by Walt Decker on Dec 2, 2020 18:05:01 GMT -5
I found the problem. However, there seems to be a limit on the number of variables on can use in the trial version. I generated an "out of resources" error. Is there a limit in the registered version?
|
|
|
Post by Chris Iverson on Dec 2, 2020 18:38:23 GMT -5
Not in the same sense, no.
There isn't a hard countable limit of the number of variables you can use in LB, but there is a memory usage limit for the application itself. I think it's around a gigabyte, so anything you're doing with variables is unlikely to run into any problems.
|
|
|
Post by Carl Gundel on Dec 2, 2020 19:01:10 GMT -5
It seems unlikely that you have encountered a limit on the number of variables. How many variables does your program have?
|
|
|
Post by Brandon Parker on Dec 2, 2020 20:39:22 GMT -5
And so that everyone is aware when they coming looking at this thread, the issue is between the WS.BORDER and WS.DLGFRAME variables; there is a missing "Or" in there...
{:0)
Brandon Parker
|
|
|
Post by Walt Decker on Dec 3, 2020 12:27:24 GMT -5
I ordered the PRO version about two hours ago. Received confirmation of the purchase but no method for obtaining the product. I will wait a while longer then see if I can get in touch with the vendor. But that is a different story.
Back to the "system out of resources."
There appears to be a small problem with STYLEBITS. In the following code the window is supposed to be created without a WS_MAXIMIZEBOX and without WS_VSCROLL and WS_HSCROLL.
A = WS.SYSMENU OR WS.THICKFRAME OR WS.MINIMIZEBOX B = WS.SYSMENU OR WS.THICKFRAME OR WS.MINIMIZEBOX OR WS.MAXIMIZEBOX OR WS.HSCROLL OR _ WS.VSCROLL
STYLEBITS #main, A, B, 0, 0
open "Colors example" for window as #main PRINT #main, "trapclose [quit]"
wait
[quit] close #main end
However, the window has a minbox, maxbox and both horz and vert scrollbars. I think in the engine code for stylebits you are XORing the style returned from getwindowlong then setting the new style with setwindowlong. If there are no style bits for ws_vscroll and ws_hscroll in the original style, the XOR will set those bits. Why the maxbox is still active, I have no idea.
As for the system resources message. It appears that trying to create a window with WS_CHILD without a caption bar causes the overflow.
|
|
|
Post by Chris Iverson on Dec 3, 2020 12:49:35 GMT -5
For the purchase, Carl's active here on the forum, and will likely contact you to provide you with your license and the installer. Sometimes his emails don't go through to people.
As for the code, have you actually defined the values of all those constants you're using?
The equivalent version using the built-in constants seems to disable the maximize box:
A = _WS_SYSMENU OR _WS_THICKFRAME OR _WS_MINIMIZEBOX OR _WS_CHILD B = _WS_SYSMENU OR _WS_THICKFRAME OR _WS_MINIMIZEBOX OR _WS_MAXIMIZEBOX OR _WS_HSCROLL _ or _WS_VSCROLL
STYLEBITS #main, A, B, 0, 0
open "Colors example" for window as #main PRINT #main, "trapclose [quit]"
wait
[quit] close #main end
And if you comment out setting the "A" value, so that WS_SYSMENU, WS_THICKFRAME and _WS_MINIMIZEBOX don't get readded to the window by the STYLEBITS command, you'll get a small-captioned window with no control boxes.
'Comment out 'A = _WS_SYSMENU OR _WS_THICKFRAME OR _WS_MINIMIZEBOX OR _WS_CHILD B = _WS_SYSMENU OR _WS_THICKFRAME OR _WS_MINIMIZEBOX OR _WS_MAXIMIZEBOX OR _WS_HSCROLL _ or _WS_VSCROLL
STYLEBITS #main, A, B, 0, 0
open "Colors example" for window as #main PRINT #main, "trapclose [quit]"
wait
[quit] close #main end
As for WS_CHILD, that's an interesting glitch, and I wonder if it's internal to LB or the SmallTalk toolkit used to write LB. I will point out that the likely reason it's happening is because it's trying to find a parent window that doesn't exist(after all, you're marking it as a child window).
|
|
|
Post by Carl Gundel on Dec 3, 2020 13:25:32 GMT -5
I ordered the PRO version about two hours ago. Received confirmation of the purchase but no method for obtaining the product. I will wait a while longer then see if I can get in touch with the vendor. But that is a different story. Let me know if you haven't received your download link and registration password yet.
|
|
|
Post by Walt Decker on Dec 3, 2020 13:27:50 GMT -5
Yes, Mr. Iverson, I defined all of the windows styles before using them since there is no list showing what is built into the LB runtime.
I think there is a glitch in the parser. Given:
NOMAINWIN
UpperLeftX = 10 UpperLeftY = 10 WindowHeight = 400 WindowWidth = 400
A = 0 B = 0 STYLEBITS #main, A, B, 0, 0
A = WS.OVERLAPPED OR WS.POPUP OR WS.VISIBLE OR WS.CLIPSIBLINGS OR WS.CLIPCHILDREN OR _ WS.CAPTION OR WS.BORDER OR WS.DLGFRAME OR WS.VSCROLL OR WS.HSCROLL OR WS.SYSMENU A = A OR WS.THICKFRAME OR WS.OVERLAPPEDWINDOW B = WS.CHILD
open "Colors example" for window as #main PRINT #main, "trapclose [quit]"
wait
[quit] CLOSE #main end
proudces a window with scrollbars when it should not make any changes to the window.
|
|
|
Post by Chris Iverson on Dec 3, 2020 13:36:57 GMT -5
Ah, ok. It's true that there's not a list; I tend to just try one to see if it works, and define it if it doesn't.
Huh, that's odd behavior. It seems that while STYLEBITS only builds the reference to what should be used for the styles, the actual values are only computed when the window is actually opened. The result you get comes out the same regardless of whether the variables used by STYLEBITS are set before or after the STYLEBITS command. I have to admit, I would not have expected that.
|
|
|
Post by Walt Decker on Dec 3, 2020 17:39:35 GMT -5
Mr. Gundel,
I received the link and activation code. Thank you.
Mr. Iverson,
I, obviously, did not expect that behavior either. I am certain I will have a number of other questions as I progress through the learning curve. Thank you for your help.
|
|