Loading ...
Sorry, an error occurred while loading the content.
 

Re: Flash Card Quiz (fcq46.bas)

Expand Messages
  • paradisejb
    I don t find a function fileExists function block of code anywhere in your program. How do you fill your info$ array? Jack
    Message 1 of 6 , Feb 12, 2013
      I don't find a "function fileExists" function block of code anywhere in your program. How do you fill your info$ array?
      Jack

      --- In libertybasic@yahoogroups.com, "green8819" wrote:
      >
      >
      >
      > A friend has pointed out some "mistakes".
      > The program itself is fine, unless someone says otherwise.
      > Please make the following corrections.
      >
      > REPLACE 1 LINE:
      > dim info$(10, 10)
      > WITH:
      > dim info$(1,1)
      >
      > REPLACE 3 LINES:
      > 'if file exists, then name of file=qz$
      > if fileExists(DefaultDir$,qzFile$) then qz$=info$(1,0)
      > qz$=info$(1,0) :qzlen=len(qz$) :qz$=mid$(qz$,4,qzlen-7)+ " Quiz"
      > WITH:
      > 'if file exists, then name of file=file$
      > if fileExists(DefaultDir$,qzFile$) then file$=info$(1,0):qz$=left$(file$,3)+"."
      >
      > REPLACE 1 LINE:
      > #w.Lbx "hide" :#w.topic "!show" :#w.topic qz$+"- ";topic$
      > WITH:
      > #w.Lbx "hide" :#w.topic "!show" :#w.topic word$(file$,1,".")+"-- "+topic$
      >
      > Thank you.
      >
    • paradisejb
      I added the function, but did not make any of the 3 replacements and the program works as expected.
      Message 2 of 6 , Feb 12, 2013
        I added the function, but did not make any of the 3 replacements and the program works as expected.

        --- In libertybasic@yahoogroups.com, "paradisejb" wrote:
        >
        > I don't find a "function fileExists" function block of code anywhere in your program. How do you fill your info$ array?
        > Jack
        >
        > --- In libertybasic@yahoogroups.com, "green8819" wrote:
        > >
        > >
        > >
        > > A friend has pointed out some "mistakes".
        > > The program itself is fine, unless someone says otherwise.
        > > Please make the following corrections.
        > >
        > > REPLACE 1 LINE:
        > > dim info$(10, 10)
        > > WITH:
        > > dim info$(1,1)
        > >
        > > REPLACE 3 LINES:
        > > 'if file exists, then name of file=qz$
        > > if fileExists(DefaultDir$,qzFile$) then qz$=info$(1,0)
        > > qz$=info$(1,0) :qzlen=len(qz$) :qz$=mid$(qz$,4,qzlen-7)+ " Quiz"
        > > WITH:
        > > 'if file exists, then name of file=file$
        > > if fileExists(DefaultDir$,qzFile$) then file$=info$(1,0):qz$=left$(file$,3)+"."
        > >
        > > REPLACE 1 LINE:
        > > #w.Lbx "hide" :#w.topic "!show" :#w.topic qz$+"- ";topic$
        > > WITH:
        > > #w.Lbx "hide" :#w.topic "!show" :#w.topic word$(file$,1,".")+"-- "+topic$
        > >
        > > Thank you.
        > >
        >
      • Mike Green
        Hello Jack, Thanks. You are right. The function is missing. Something seemed to have gone wrong when I did the copy/paste in my previous post. Here is the
        Message 3 of 6 , Feb 12, 2013
          Hello Jack,
          Thanks. You are right. The function is missing.
          Something seemed to have gone wrong when I did the copy/paste in my previous post. Here is the correction:

          PLEASE REPLACE:
          sub pause delay
          stTime = time$("ms")
          while time$("ms") <<<< WEND is missing
          WITH:
          sub pause delay
          stTime = time$("ms")
          while time$("ms")<stTime+delay: wend
          end sub
          function fileExists(path$,filename$)
          files path$, filename$, info$()
          fileExists = val(info$(0, 0))
          end function

          1) "dim info$(1,1)" is enough for this program.
          "dim info$(10, 10)" is too high.

          2) The other two corrections are NOT necessry if the user is saving his quiz files as, for example:
          01-History
          02-Geography

          Instead, if the quiz files are saved as:
          History
          Geography
          then the two corrections ARE necessary.

          Thanks for the feedback. Greatly appreciated.

          To: libertybasic@yahoogroups.com
          From: jburman1860@...
          Date: Tue, 12 Feb 2013 21:38:55 +0000
          Subject: [libertybasic] Re: Flash Card Quiz (fcq46.bas)


























          I added the function, but did not make any of the 3 replacements and the program works as expected.



          --- In libertybasic@yahoogroups.com, "paradisejb" wrote:

          >

          > I don't find a "function fileExists" function block of code anywhere in your program. How do you fill your info$ array?

          > Jack

          >

          > --- In libertybasic@yahoogroups.com, "green8819" wrote:

          > >

          > >

          > >

          > > A friend has pointed out some "mistakes".

          > > The program itself is fine, unless someone says otherwise.

          > > Please make the following corrections.

          > >

          > > REPLACE 1 LINE:

          > > dim info$(10, 10)

          > > WITH:

          > > dim info$(1,1)

          > >

          > > REPLACE 3 LINES:

          > > 'if file exists, then name of file=qz$

          > > if fileExists(DefaultDir$,qzFile$) then qz$=info$(1,0)

          > > qz$=info$(1,0) :qzlen=len(qz$) :qz$=mid$(qz$,4,qzlen-7)+ " Quiz"

          > > WITH:

          > > 'if file exists, then name of file=file$

          > > if fileExists(DefaultDir$,qzFile$) then file$=info$(1,0):qz$=left$(file$,3)+"."

          > >

          > > REPLACE 1 LINE:

          > > #w.Lbx "hide" :#w.topic "!show" :#w.topic qz$+"- ";topic$

          > > WITH:

          > > #w.Lbx "hide" :#w.topic "!show" :#w.topic word$(file$,1,".")+"-- "+topic$

          > >

          > > Thank you.

          > >

          >



















          [Non-text portions of this message have been removed]
        • Stefan Pendl
          ... Might be better to upload a ZIP archive that replaces the previously posted one. Posts can be truncated due to length limitations, that are unknown to the
          Message 4 of 6 , Feb 13, 2013
            Am 13.02.2013 08:27, schrieb Mike Green:
            >
            > Hello Jack,
            > Thanks. You are right. The function is missing.
            > Something seemed to have gone wrong when I did the copy/paste in my previous post. Here is the correction:
            >

            Might be better to upload a ZIP archive that replaces the previously
            posted one.

            Posts can be truncated due to length limitations, that are unknown to
            the group members.

            In addition uploading files avoids copy and paste errors ;-)


            --
            Stefan Pendl
            http://stefanpendl.runbasichosting.com/

            LB 4.04 Pro ... http://www.libertybasic.com/assist.html
            LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

            LB Community Wiki .............. http://basic.wikispaces.com/
            LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
            LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

            Books at http://www.lulu.com/ and http://www.amazon.com/
            Alyce Watson ... APIs for Liberty BASIC
            Carl Gundel .... Beginning Programming with Liberty BASIC

            Windows 7 Home Premium 64-bit SP1
            AMD Turion X2 RM-70 2GHz, 4GB RAM
          Your message has been successfully submitted and would be delivered to recipients shortly.