Author |
Topic: LB 4.5 is underwhelming (Read 2462 times) |
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Re: LB 4.5 is underwhelming
« Reply #10 on: Aug 1st, 2015, 07:57am » |
|
Yes, Dear Rod,
I did but LB goes inside the branch label and run it, displays Tiiiick the code is wrong LB accepted, and makes a wrong execution.
I wonder, are you going to make me refuse what I seen on my screen, or you ask me to write correct code because LB accepts and run wrong codes. So we must pay more attention.!
You know what? I run my code on LBB just to help me find if there were errors I made not reported by LB.
With all respects, Sarmed
|
|
Logged
|
|
|
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Re: LB 4.5 is underwhelming
« Reply #11 on: Aug 1st, 2015, 08:08am » |
|
Rod,
As you here, please note. There is something wrong with timer at least under LB, I have to change any SUB in my program into branch label, just to prevents my program from got freeze after I use many timers, of course I close each one at the beginning of any branch, but this is the only way I have in spite I don't use any SUBs with any timer in my program, the window got freeze when I touched it's capture. Therefor I said the problem is in Timer not in subs as they said on their bug tracker site. I hope Carl will take care of that.
Regards Sarmed
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LB 4.5 is underwhelming
« Reply #12 on: Aug 1st, 2015, 09:27am » |
|
on Aug 1st, 2015, 07:57am, SarmedNafi wrote:| I run my code on LBB just to help me find if there were errors I made not reported by LB. |
|
To be fair, sometimes you need to do the opposite! The program you listed should report something like "No such subroutine 'tick'" but in LBB the error is silently ignored. 
But you are right that in LB 4.04 and LB 4.5.0 the timer has more problems than just the SUB handler. In particular it upsets the operation of the PROMPT statement.
So, since there's obviously something not right with TIMER, I'm not surprised that you have encountered other issues with its use.
Richard.
|
|
Logged
|
|
|
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Re: LB 4.5 is underwhelming
« Reply #13 on: Aug 1st, 2015, 10:28am » |
|
Rod,
If you still here please run the following, It is a disaster. The second release of LB 450 will RUN all the following Branches whatever names they have or quantity.
Please tell Carl I am sure he listen well to you.
'code---------- timer 100, tick wait
[ticktacktoock] print "ticktacktoock" wait
[secondTick] print "secondTick" wait
'code---------
Regards Sarmed
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LB 4.5 is underwhelming
« Reply #14 on: Aug 1st, 2015, 11:17am » |
|
on Aug 1st, 2015, 10:28am, SarmedNafi wrote:| If you still here please run the following, It is a disaster. |
|
I don't think it is a "disaster", but it is certainly surprising and affects not only the timer. Try this program in LB and you'll see that BUTTON events misbehave as well (click on the button three times and watch what happens):
Code: UpperLeftX = 1
UpperLeftY = 1
button #w, "Click me and view the mainwin", tick, UL, 20, 100
open "Event bug" for window as #w
wait
print "Fell through a WAIT statement: should never happen!!"
[ticktacktoock]
print "ticktacktoock"
wait
print "Fell through a WAIT statement: should never happen!!"
[secondTick]
print "secondTick"
wait
print "Fell through a WAIT statement: should never happen!!" I am beginning to think this bug explains the occasional report I have seen of code following a WAIT statement being executed - because it's exactly what happens in this case!
In LBB there is no way the statement immediately following a WAIT can be executed, unless it has a label.
Richard.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LB 4.5 is underwhelming
« Reply #15 on: Aug 21st, 2015, 09:41am » |
|
Now that LB 4.5.0 is officially released I thought it appropriate to list once again a library for LBB which supports the new string functions: after$, afterlast$, remchar$, replstr$, upto$ and httpget$ (I've also included the endswith function although I can't find it mentioned anywhere in the LB 4.5.0 help file!).
To ensure that a program using one or more of these functions is fully compatible with both LBB and LB 4.5.0 you should save the code listed below to a file (called lb45func.bas or something like that). Then add this command at the very end of your program:
Code:(must start in the first column and end with a newline).
Because this command is ignored by LB the native functions will be called when running in LB 4.5.0 and the library functions when running in LBB.
Here is the library:
Code:' LB 4.5.0 function library for LB Booster
' by Richard Russell, http://lbbooster.com
function after$(source$, match$)
i = instr(source$, match$)
if i then after$ = mid$(source$,i+len(match$))
end function
function afterlast$(source$, match$)
do : i = j
j = instr(source$, match$, j+1)
loop until j = 0
if i then afterlast$ = mid$(source$,i+len(match$))
end function
function endswith(source$, match$)
endswith = right$(source$,len(match$)) = match$
end function
function remchar$(source$, charset$)
for i = 1 to len(charset$)
do
j = instr(source$, mid$(charset$,i,1))
if j then source$ = left$(source$,j-1);mid$(source$,j+1)
loop until j = 0
next
remchar$ = source$
end function
function replstr$(source$, old$, new$)
do
i = instr(source$, old$, i+1)
if i then
source$ = left$(source$,i-1);new$;mid$(source$,i+len(old$))
i = i + len(new$) - 1
end if
loop until i = 0
replstr$ = source$
end function
function upto$(source$, match$)
i = instr(source$, match$)
if i then upto$=left$(source$,i-1) else upto$=source$
end function
function httpget$(url$)
open "WININET.DLL" for dll as #net
calldll #net, "InternetOpenA", "LB Booster" as ptr, 0 as long, _
0 as long, 0 as long, 0 as long, hnet as ulong
calldll #net, "InternetOpenUrlA", hnet as ulong, url$ as ptr, _
"" as ptr, 0 as long, 0 as long, 0 as long, hurl as ulong
buffer$ = space$(1000)
struct httpget, nread as long
do
buflen = len(buffer$)
calldll #net, "InternetReadFile", hurl as ulong, _
buffer$ as ptr, buflen as long, httpget as struct, res as long
httpget$ = httpget$ + left$(buffer$, httpget.nread.struct)
loop until httpget.nread.struct = 0
calldll #net, "InternetCloseHandle", hurl as ulong, res as long
calldll #net, "InternetCloseHandle", hnet as ulong, res as long
close #net
end function Richard.
|
|
|
|
|