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

Can you print a "!" on its own?

Expand Messages
  • tony.tampa
    Ok im working on a little utility that needs to sent text 1 character at a time to a graphics box in the gui. works fine.. with a few work arounds.. but iv
    Message 1 of 8 , Jan 3, 2012
    • 0 Attachment
      Ok im working on a little utility that needs to sent text 1 character at a time to a graphics box in the gui. works fine.. with a few work arounds.. but iv noticed 1 little thing that happens. If you

      print #main.gbox1,"!"

      the program stopes and closes the windows ....

      Ok now if i do the following

      print #main.gbox1,"the quick brown fox!"


      the program stops once again...

      ok heres a doozy.

      print #main.gbox1,"\!" or print #main.gbox1,"\!the quick brown fox!"

      you can print it if you do the \ newline/cr. but you try and get it to work without \ or |
      Anyway what you think. Bug. or hmmm as microsoft put it. "FEATURE"....

      ohh heres the error log for the error lol

      Error log timestamp Wednesday 01/04/12 04:53:30 PM

      Runtime error: Bad command for #main.GFX1, nbnnba!

      Error(Exception)>>defaultAction
      Error(Exception)>>activateHandler: <anUndefinedObject>
      Error(Exception)>>handle
      Error(Exception)>>signal
      Error class(Exception class)>>signal: <'Bad command for #mai...'>
      BasicProgram(Object)>>error: <'Bad command for #mai...'>
      BasicProgram>>terminateRun: <anError>
      [] in BasicProgram>>errorHandlerBlock
      ExceptionHandler>>evaluateResponseBlock: <aBlockClosure> for: <anError>
      [] in ExceptionHandler>>handle:
      ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure>
      BlockClosure>>invisibleEnsure: <aBlockClosure>
      ExceptionHandler>>handle: <anError>
      ExceptionHandler>>findHandler: <anError>
      Error(Exception)>>activateHandler: <anExceptionHandler>
      Error(Exception)>>handle
      Error(Exception)>>signal
      Error class(Exception class)>>signal: <'Bad command for #mai...'>
      BasicProgram(Object)>>error: <'Bad command for #mai...'>
      BasicProgram>>runError: <'Bad command for #mai...'>
      BasicProgram>>badCommand: <'nbnnba!'> forHandle: <'#main.GFX1'>
      LibGraphDevice(BasicGraphicDevice)>>writeItem: <'nbnnba!'>
      LibGraphPane>>writeItem: <'nbnnba!'>
      LibGraphPane(SubPane)>>writeItemCr: <'nbnnba!'>
      [] in PrintCommand>>deviceCr:handle:
      BlockClosure>>value: <aBasicProgram> value: <'#main.GFX1'> value: <aBasicStringContext>
      BasicTripleParameterContextHolder>>value
      [] in BasicProgram>>begin
      ExceptionHandler>>evaluateProtectedBlock: <aBlockClosure>
      [] in ExceptionHandler>>activateDuring:
      ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure>
      BlockClosure>>invisibleEnsure: <aBlockClosure>
      ExceptionHandler>>activateDuring: <aBlockClosure>
      ExceptionHandler class>>handle: <anError class> with: <aBlockClosure> during: <aBlockClosure>
      BlockClosure>>on: <anError class> do: <aBlockClosure>
      BasicProgram>>begin
      BasicProgram>>beginIfStopped
      BasicProgram>>beginFunction: <'button3Click'>
      BasicProgram>>breakCallbackForSubName: <'button3Click'> arguments: <anOrderedCollection>
      BasicProgram>>callbackForSubName: <'button3Click'> arguments: <anOrderedCollection>
      BasicProgram>>handlerName: <'button3Click'> evaluate: <aBlockClosure> callParameters: <anOrderedCollection>
      BasicProgram>>submitHandlerName: <'button3Click'> evaluate: <aBlockClosure> callParameters: <anOrderedCollection>
      BasicProgram>>submitHandlerName: <'button3Click'> callParameters: <anOrderedCollection>
      LibButton>>click
      BasicWindow>>click: <aLibButton>
      LibButton(Button)>>click: <aLibButton>
      Message>>perform
      Message>>evaluate
      LibButton(Object)>>triggerEvent: <#clicked>
      LibButton(Button)>>triggerClickedEvent
    • David Speck
      Tony, I m pretty sure that the ! is a control prefix. Have you tried printing CHR$(33) Dave ... [Non-text portions of this message have been removed]
      Message 2 of 8 , Jan 3, 2012
      • 0 Attachment
        Tony,

        I'm pretty sure that the "!" is a control prefix.

        Have you tried printing CHR$(33)

        Dave


        On 1/3/2012 6:18 PM, tony.tampa wrote:
        > Ok im working on a little utility that needs to sent text 1 character at a time to a graphics box in the gui. works fine.. with a few work arounds.. but iv noticed 1 little thing that happens. If you
        >
        > print #main.gbox1,"!"
        >
        > the program stopes and closes the windows ....
        >
        > Ok now if i do the following
        >
        > print #main.gbox1,"the quick brown fox!"
        >
        >
        > the program stops once again...
        >
        > ok heres a doozy.
        >
        > print #main.gbox1,"\!" or print #main.gbox1,"\!the quick brown fox!"
        >
        > you can print it if you do the \ newline/cr. but you try and get it to work without \ or |
        > Anyway what you think. Bug. or hmmm as microsoft put it. "FEATURE"....


        [Non-text portions of this message have been removed]
      • tony.tampa
        ... yes chr$(33) wont work.. just closes the program down... control prefix. hmmmmm .well i thought that.. untill i wrote a lookforward routine.. and managed
        Message 3 of 8 , Jan 3, 2012
        • 0 Attachment
          --- In libertybasic@yahoogroups.com, David Speck <MedelecInstruments@...> wrote:
          >
          > Tony,
          >
          > I'm pretty sure that the "!" is a control prefix.
          >
          > Have you tried printing CHR$(33)
          >

          yes chr$(33) wont work.. just closes the program down...
          control prefix. hmmmmm .well i thought that.. untill i wrote a lookforward routine.. and managed to ocasionaly get a ! to apear on its own.. Anyway ill have to write a work round for " | " and "\" as they are control characters (or at least carrage returns/newlines) Ill just have to do the same for "!"

          ANyone else have any idears ?
        • Jim Hiley
          To send text to a graphics box you have to precede it with a or | . Instead of print #main.gbox1, ! you need to do print #main.gbox1, ! If you are
          Message 4 of 8 , Jan 3, 2012
          • 0 Attachment
            To send text to a graphics box you have to precede it with a "\" or "|".
            Instead of
            print #main.gbox1,"!"
            you need to do
            print #main.gbox1,"\!"

            If you are sending text one character at a time, you will need to precede
            every character with "\"

            Anything else and you are sending a command.
            Look at: print #handle, "\text" in the Help file.

            Jim


            -----Original Message-----
            From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
            Behalf Of tony.tampa
            Sent: Wednesday, 4 January 2012 10:19
            To: libertybasic@yahoogroups.com
            Subject: [libertybasic] Can you print a "!" on its own?

            Ok im working on a little utility that needs to sent text 1 character at a
            time to a graphics box in the gui. works fine.. with a few work arounds..
            but iv noticed 1 little thing that happens. If you

            print #main.gbox1,"!"

            the program stopes and closes the windows ....

            Ok now if i do the following

            print #main.gbox1,"the quick brown fox!"


            the program stops once again...

            ok heres a doozy.

            print #main.gbox1,"\!" or print #main.gbox1,"\!the quick brown fox!"

            you can print it if you do the \ newline/cr. but you try and get it to
            work without \ or |
            Anyway what you think. Bug. or hmmm as microsoft put it. "FEATURE"....
          • Stefan Pendl
            ... If you send one character at a time, you need to use the PLACE command too to avoid the line feed. I think there have been some terminal or type-writer
            Message 5 of 8 , Jan 4, 2012
            • 0 Attachment
              Am 04.01.2012 05:41, schrieb Jim Hiley:
              > To send text to a graphics box you have to precede it with a "\" or "|".
              > Instead of
              > print #main.gbox1,"!"
              > you need to do
              > print #main.gbox1,"\!"
              >
              > If you are sending text one character at a time, you will need to precede
              > every character with "\"
              >
              > Anything else and you are sending a command.
              > Look at: print #handle, "\text" in the Help file.
              >
              > Jim
              >

              If you send one character at a time, you need to use the PLACE command
              too to avoid the line feed.

              I think there have been some terminal or type-writer programs posted in
              the past, so you will find some useful code by searching the group online.


              --
              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
            • tony.tampa
              ... To be honest the makes it work by the looks of it.. andyou can send single characters without using it just continues from the last letter. The problem
              Message 6 of 8 , Jan 4, 2012
              • 0 Attachment
                --- In libertybasic@yahoogroups.com, "Jim Hiley" <jim@...> wrote:
                >
                > To send text to a graphics box you have to precede it with a "\" or "|".
                > Instead of
                > print #main.gbox1,"!"
                > you need to do
                > print #main.gbox1,"\!"
                >
                > If you are sending text one character at a time, you will need to precede
                > every character with "\"
                >
                > Anything else and you are sending a command.
                > Look at: print #handle, "\text" in the Help file.

                To be honest the \ makes it work by the looks of it.. andyou can send single characters without using \ it just continues from the last letter.

                The problem is i need to place a "!" on the screen .. nothing else.. but unless i add a character or 2 . i cant it just errors and closes the window.

                its just wierd.

                mark
              • Jim Hiley
                Like this: nomainwin WindowWidth = 135 WindowHeight = 160 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
                Message 7 of 8 , Jan 4, 2012
                • 0 Attachment
                  Like this:

                  nomainwin
                  WindowWidth = 135
                  WindowHeight = 160
                  UpperLeftX=int((DisplayWidth-WindowWidth)/2)
                  UpperLeftY=int((DisplayHeight-WindowHeight)/2)

                  graphicbox #main.graphicbox2, 5, 5, 110, 110

                  open "Test" for window as #main
                  #main.graphicbox2, "down; fill yellow; flush"
                  #main, "trapclose [quit.main]"
                  #main.graphicbox2, "place 50 50"
                  #main.graphicbox2,"\!"
                  wait

                  [quit.main] 'End the program
                  close #main
                  end

                  Jim

                  -----Original Message-----
                  From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
                  Behalf Of tony.tampa
                  Sent: Thursday, 5 January 2012 11:44
                  To: libertybasic@yahoogroups.com
                  Subject: [libertybasic] Re: Can you print a "!" on its own?



                  --- In libertybasic@yahoogroups.com, "Jim Hiley" <jim@...> wrote:
                  >
                  > To send text to a graphics box you have to precede it with a "\" or "|".
                  > Instead of
                  > print #main.gbox1,"!"
                  > you need to do
                  > print #main.gbox1,"\!"
                  >
                  > If you are sending text one character at a time, you will need to precede
                  > every character with "\"
                  >
                  > Anything else and you are sending a command.
                  > Look at: print #handle, "\text" in the Help file.

                  To be honest the \ makes it work by the looks of it.. andyou can send single
                  characters without using \ it just continues from the last letter.

                  The problem is i need to place a "!" on the screen .. nothing else.. but
                  unless i add a character or 2 . i cant it just errors and closes the window.


                  its just wierd.

                  mark
                • Carl Gundel
                  ... How does chr$(33) shut the program down? What happens? -Carl
                  Message 8 of 8 , Jan 4, 2012
                  • 0 Attachment
                    --- In libertybasic@yahoogroups.com, "tony.tampa" <markkg1@...> wrote:
                    > --- In libertybasic@yahoogroups.com, David Speck <MedelecInstruments@> wrote:
                    > >
                    > > Tony,
                    > >
                    > > I'm pretty sure that the "!" is a control prefix.
                    > >
                    > > Have you tried printing CHR$(33)
                    >
                    > yes chr$(33) wont work.. just closes the program down...
                    > control prefix. hmmmmm .well i thought that.. untill i wrote a lookforward routine.. and managed to ocasionaly get a ! to apear on its own.. Anyway ill have to write a work round for " | " and "\" as they are control characters (or at least carrage returns/newlines) Ill just have to do the same for "!"
                    >
                    > ANyone else have any idears ?

                    How does chr$(33) shut the program down? What happens?

                    -Carl
                  Your message has been successfully submitted and would be delivered to recipients shortly.