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

41585RE: [libertybasic] SIMPLE

Expand Messages
  • henriknilson
    Oct 1, 2010
      Ok Stefan, if it is wrong from a GUI point of view, then can we use copy and paste for the following values inside the two txtboxs just by one step, i.e. to put the curser on the upper txtbox and past two variables, the first one would be in the upper txtbox and the second would be in the lower txtbox."just by one step"
      There are some serials of some software accept this way although the boxes are arranged horizontally in this case.
      Thank you

      The variables are:
      7
      11


      'The code
      nomainwin
      WindowWidth = 400
      WindowHeight = 300
      TEXTBOX #A.txtbox1, 100,140,60,25
      TEXTBOX #A.txtbox2, 100,170,60,25
      STATICTEXT #A "Input 1=", 30, 140, 60, 25
      STATICTEXT #A "Input 2=", 30, 165, 60, 25
      GRAPHICBOX #A.textresult, 100, 40, 160, 80
      BUTTON #A.Default, "Calculate",[enter],UL, 100, 230,70 , 25
      OPEN "TEXTBOX" FOR DIALOG AS #A
      #A "trapclose [quit]"
      #A "font Times_New_Roman 12"

      '#A.txtbox1 "40"
      '#A.txtbox2 "10"

      wait
      [enter]
      PRINT #A.txtbox1, "!contents? a"
      PRINT #A.txtbox2, "!contents? b"
      #A.textresult "place 5 25"
      #A.textresult "\Input 1= "; a;
      #A.textresult "\Input 2= "; b;
      #A.textresult "\Multiplication= ";a*b;
      wait
      [quit]
      CLOSE #A
      END



      > Thanks a lot John, I have modified the code lightly, now is
      > it possible to have the results written horizontally instead
      > of vertically, I would like to learn how to control the
      > locations please.

      Even if you are insisting of using one single text box to collect two values from the user, it is plain wrong from a GUI point of
      view.
      In addition it adds another layer of complexity to the whole thing.

      Using two separate text boxes to collect two separate values from the user is the preferred way.
      You just have to ask each text box for its contents and there is no parsing involved.

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

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

      Liberty BASIC 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 RTM
      AMD Turion X2 RM-70 2GHz, 4GB RAM
    • Show all 17 messages in this topic