LB Booster
« Works in LB, not in LBB »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:52am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Works in LB, not in LBB  (Read 1054 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Works in LB, not in LBB
« Thread started on: Jan 27th, 2015, 01:49am »

I have some programs that work in LB4, but not in LBB.
In one program LBB seems to cutoff the four leftmost characters of a file name leading to a file not found error.

Code:
[specialList]
    pgCtr = 0 : lnCtr = 99 : listCount = 0 : sectCtr = 0
    menu #rept, "Close", "Close", [reptClose]
    open " STRUCTURE LIST" for text_fs as #rept
    #rept, "!trapclose [reptClose]"
    rptTtl$ = "  Structure Listing by Department and Section with Time Codes " + date$()
    gosub [newPage]
    files path$, info$(
    fc = val(info$(0, 1))    ' dept folders
    for cf = 1 to fc
        foldName$ = info$(cf, 0)
        files foldName$,  info2$(
        folCt = val(info2$(0,1))   'section folders
        for cf2 = 1 to folCt
            fold2Name$ = info2$(cf2,0)
            if right$(fold2Name$,5) = "Admin" then
                fileName$ = fold2Name$ + "\Admin.dat"   
                open fileName$ for input as #head  ' error on this line
                    line input #head, deptHead$
                close #head
                #rept, chr$(10);"  ";getFldr$(foldName$);"    Dept. Head = "; deptHead$
            else
              fileName$ = fold2Name$ + "\Admin.dat"
              open fileName$ for input as #supv
                 line input #supv, sectData$
              close #supv
            f$ =  getFldr$(fold2Name$)
            #rept, space$(5);f$; space$(20-len(f$));"Supervisor = ";word$(sectData$,1,"|")
            namLine$ = space$(10)
            for n = 2 to 9
                namLine$ = namLine$ + tb$(word$(sectData$,n,"|"),17)
                if namLine$ = "" then exit for
            next
           #rept, namLine$
           lnCtr = lnCtr + 1
           end if
        next
        sectCtr = sectCtr + folCt
    next
    #rept " "
    #rept str$(fc); " Departments   "; sectCtr; " Sections"
    wait

 [reptClose]
    close #rept
    wait

 


r.m.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: Works in LB, not in LBB
« Reply #1 on: Jan 27th, 2015, 01:57am »

In this program LBB does not print the employee information line. (namLine$), but in LB those lines print.

Code:

    pgCtr = 0 : lnCtr = 99 : listCount = 0
    menu #rept, "Close", "Close", [reptClose]
    open " EMPLOYEE LIST" for text_fs as #rept
    #rept, "!trapclose [reptClose]"
    rptTtl$ = tw$ + " Listing by Department and Section  " + date$()
    gosub [newPage]
    files path$, info$(

    dfc = val(info$(0, 1))    ' dept folder count
    for cf = 1 to dfc
        foldName$ = info$(cf, 0)
        #rept, chr$(10);"  ";getFldr$(foldName$)
        files foldName$,  info2$(
        sfc = val(info2$(0,1))      'section folder count
        sfc2 = val(info2$(0,0))      'section file count
        for cf2 = sfc2+1 to sfc + sfc2    'sfc2+1 is first folder
            fold2Name$ = info2$(cf2,0)
            #rept, space$(5);getFldr$(fold2Name$)
            files fold2Name$, ent$, info3$(
            efc = val(info3$(0,0))  'employee file count
            for cf3 = 1 to efc
                fileName$ = fold2Name$ + "\" + info3$(cf3,0)
                rgt$ = right$(fileName$,3)
                if INSTR("hlysal", rgt$) = 0 then [skip]

                y$ = "" : z$ = ""
                open fileName$ for input as #6
                    input #6,x$ 
                    if not(eof(#6)) then input #6, y$
                    if not(eof(#6)) then input #6, z$
                close #6
                x$ = info3$(cf3,0)
                perName$ = left$(x$,len(x$)-4)
                namLine$ = space$(10)  + tb$(word$(x$,3,"|"),17) + word$(x$,4,"|") + " " + word$(x$,5,"|") _
                     + space$(15 - len(word$(x$,4,"|"))) _
                     + tb$(word$(x$,6,"|"),5) + tb$(word$(x$,12,"|"),14) + tb$(word$(x$,13,"|"),27)
                namLine$ = space$(10)  +  tb$(perName$,20) +" "+ word$(y$,4,"|") +" "+ word$(y$,6,"|")
                listCount = listCount + 1          ' count name records
                #rept, namLine$; "  "; z$
                lnCtr = lnCtr + 1
           [skip]
           'if z$ <> "" then #rept, space$(30);z$
           next
        next
    next
    #rept " "
    #rept str$(dfc); " Departments   "; listCount; " persons"
    wait

 [reptClose]
    close #rept
    wait

 


r.m.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: Works in LB, not in LBB
« Reply #2 on: Jan 27th, 2015, 02:01am »

The third program is not mine. It is a Pyramid Solitare game by "WebbSoft" I am not sure where I got the source code.

I compiled it into an executable using LBB, but when I run it, nothing happens, or else it goes so fast that it looks like nothing happens

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Works in LB, not in LBB
« Reply #3 on: Jan 27th, 2015, 07:31am »

on Jan 27th, 2015, 01:49am, Alincon wrote:
I have some programs that work in LB4, but not in LBB.

I presume you've already checked the Compatibility section of the LBB docs to make sure you are not relying on a feature that is not fully supported?

I am of course very happy to investigate, but as you'll appreciate I need to be able to reproduce the issue here. So I must have some code which is sufficiently self-contained that I can run it and observe the effect for myself.

Please contact me by private email, either with the entire program attached, or if it's too unwieldy (or confidential) to send in its entirely, please try to 'boil down' the code to something smaller which still exhibits the effect.

You can find my email address in the LBB Help menu.

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Works in LB, not in LBB
« Reply #4 on: Jan 27th, 2015, 08:11am »

on Jan 27th, 2015, 01:57am, Alincon wrote:
Code:
                namLine$ = space$(10)  + tb$(word$(x$,3,"|"),17) + word$(x$,4,"|") + " " + word$(x$,5,"|") _
                     + space$(15 - len(word$(x$,4,"|"))) _
                     + tb$(word$(x$,6,"|"),5) + tb$(word$(x$,12,"|"),14) + tb$(word$(x$,13,"|"),27)
                namLine$ = space$(10)  +  tb$(perName$,20) +" "+ word$(y$,4,"|") +" "+ word$(y$,6,"|") 

Did you mean to have two consecutive statements that assign to the same variable (namLine$)? The first will of course have no effect, and could be deleted without changing the end result. I'm assuming function tb$() doesn't have some side-effect that you are relying on.

Richard.
« Last Edit: Jan 27th, 2015, 08:26am by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Works in LB, not in LBB
« Reply #5 on: Jan 29th, 2015, 5:58pm »

on Jan 27th, 2015, 01:57am, Alincon wrote:
In this program LBB does not print the employee information line. (namLine$), but in LB those lines print.

OK, with the help of the OP I have tracked down the incompatibility. It arises because LBB assumes that the first parameter of the FILES statement will be a full path name, i.e. a string starting with the drive letter; for example:

Code:
    FILES "C:\path", info$() 

However in his code the OP is passing the first parameter of FILES without the drive letter, for example:

Code:
    FILES "\path", info$() 

This is causing LBB to misbehave.

The LB docs simply refer to the first parameter as pathSpec$; all of the examples include a drive letter but it isn't stated whether one should always be supplied.

I ought probably to modify LBB to be more compatible with LB in this respect, but in the meantime the problem is easily fixed in the OP's code by replacing:

Code:
    files foldName$, info2$( 

with:

Code:
    files "c:";foldName$, info2$( 

This will not affect compatibility with LB 4.04.

Richard.
« Last Edit: Jan 29th, 2015, 7:57pm by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Works in LB, not in LBB
« Reply #6 on: Jan 30th, 2015, 1:07pm »

on Jan 29th, 2015, 5:58pm, Richard Russell wrote:
I ought probably to modify LBB to be more compatible with LB

I've updated LBB to v2.86; it is no longer necessary for the first parameter of FILES to include the drive letter. The OP's program now runs without modification.

Richard.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: Works in LB, not in LBB
« Reply #7 on: Jan 31st, 2015, 8:36pm »

Good detective work. I never would have suspected that the drive letter was missing. I just took what FILES gave me.
Anyway, I expect that this fix should also explain why the second program I mentioned above does not work.
But where do I download 2.86?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Works in LB, not in LBB
« Reply #8 on: Jan 31st, 2015, 10:01pm »

on Jan 31st, 2015, 8:36pm, Alincon wrote:
But where do I download 2.86?

The usual place, i.e. at the LBB website. I've simply updated it 'in situ', which means anybody downloading LBB now will automatically pick up the latest version.

Richard.
« Last Edit: Jan 31st, 2015, 10:01pm by Richard Russell » User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx It's baaaak
« Reply #9 on: Mar 5th, 2015, 02:22am »

The files command still omits the drive letter in v3.0; my program does not work unless I add it.

Code:
    fileName$ = "c:" + info$(index,0) + "\"+ areaTbl$(index)+".dat"
 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls