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

RE: [libertybasic] How do I?

Expand Messages
  • Stefan Pendl
    ... Inkey$ only works with a graphics control in a GUI window. Are you using the console window? A solution for the console window is as follows: ---code
    Message 1 of 5 , Nov 7, 2008
      >
      > Look in the LB help file for the Inkey$ command
      >
      >
      >> Capture a keystroke, so that I can do:
      >>
      >> Press any key to continue
      >>
      >> In VB I think I had a command called Get that would allow me
      >> to do this but
      >>
      >> I believe that does something else in VB.
      >

      Inkey$ only works with a graphics control in a GUI window.

      Are you using the console window?

      A solution for the console window is as follows:

      '---code start (watch for line wraps)
      print
      print "Press any key to continue ..."
      print

      dummy$ = input$(1)

      print
      print "Finished !!!"
      print
      end
      '---code end

      ---
      Stefan Pendl
    • Gordon Sweet
      I suspect sooner or later you will want to know how to do this using a window Gordon S, nomainwin open Inkey$ Test for graphics_nsb as #1 #1 cls;
      Message 2 of 5 , Nov 8, 2008
        I suspect sooner or later you will want to know how to do this using a window Gordon S,

        nomainwin
        open "Inkey$ Test" for graphics_nsb as #1
        #1 "cls; trapclose [quit]; down; place 100 100"

        [Loop]
        #1 "setfocus; when characterInput [fetch]"
        wait

        [fetch]
        key$ = Inkey$
        keyV = asc(right$(key$, 1))
        #1 "\";key$;" ASCII ";keyV
        goto [Loop]

        [quit]
        close #1 : end


        [Non-text portions of this message have been removed]
      • Mark Gedak
        Thanks Stefan, this is what I m looking for. ... [Non-text portions of this message have been removed]
        Message 3 of 5 , Nov 8, 2008
          Thanks Stefan, this is what I'm looking for.

          On Fri, Nov 7, 2008 at 11:53 PM, Stefan Pendl <pendl2megabit@...>wrote:

          > >
          > > Look in the LB help file for the Inkey$ command
          > >
          > >
          > >> Capture a keystroke, so that I can do:
          > >>
          > >> Press any key to continue
          > >>
          > >> In VB I think I had a command called Get that would allow me
          > >> to do this but
          > >>
          > >> I believe that does something else in VB.
          > >
          >
          > Inkey$ only works with a graphics control in a GUI window.
          >
          > Are you using the console window?
          >
          > A solution for the console window is as follows:
          >
          > '---code start (watch for line wraps)
          > print
          > print "Press any key to continue ..."
          > print
          >
          > dummy$ = input$(1)
          >
          > print
          > print "Finished !!!"
          > print
          > end
          > '---code end
          >
          > ---
          > Stefan Pendl
          >
          >
          >


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.