10 get input a$
20 print a$
20 print a$
Code:
FUNCTION PBMAIN a$=INPUTBOX$("What's your input?","Box title") MSGBOX(a$) END FUNCTION
FUNCTION PBMAIN a$=INPUTBOX$("What's your input?","Box title") MSGBOX(a$) END FUNCTION
#PBFORMS Created '-------------------------------------------------------------------------------- ' The first line in this file is a PBForms metastatement. ' It should ALWAYS be the first line of the file. Other ' PBForms metastatements are placed at the beginning and ' ending of blocks of code that should be edited using ' PBForms only. Do not edit or delete these ' metastatements or PBForms will not be able to reread ' the file correctly. See the PBForms documentation for ' more information. ' Beginning blocks begin like this: #PBForms Begin ... ' Ending blocks begin like this: #PBForms End ... ' Other PBForms metastatements such as: ' #PBForms Declarations ' are used to tell PBForms where to insert additional ' code. Feel free to make changes anywhere else in the file. '-------------------------------------------------------------------------------- #COMPILE EXE #DIM ALL '-------------------------------------------------------------------------------- ' ** Includes ** '-------------------------------------------------------------------------------- #PBFORMS Begin Includes #IF NOT %DEF(%WINAPI) #INCLUDE "WIN32API.INC" #ENDIF #PBFORMS End Includes '-------------------------------------------------------------------------------- '-------------------------------------------------------------------------------- ' ** Constants ** '-------------------------------------------------------------------------------- #PBFORMS Begin Constants %IDD_DIALOG1 = 101 %IDC_TEXTBOX1 = 1001 %IDC_TEXTBOX2 = 1002 %IDC_BUTTON1 = 1003 %IDC_BUTTON2 = 1004 #PBFORMS End Constants '-------------------------------------------------------------------------------- '-------------------------------------------------------------------------------- ' ** Declarations ** '-------------------------------------------------------------------------------- DECLARE CALLBACK FUNCTION ShowDIALOG1Proc() DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG #PBFORMS Declarations '-------------------------------------------------------------------------------- '-------------------------------------------------------------------------------- FUNCTION PBMAIN() ShowDIALOG1 %HWND_DESKTOP END FUNCTION '-------------------------------------------------------------------------------- '-------------------------------------------------------------------------------- ' ** CallBacks ** '-------------------------------------------------------------------------------- CALLBACK FUNCTION ShowDIALOG1Proc() LOCAL inputText AS STRING SELECT CASE CBMSG CASE %WM_COMMAND SELECT CASE CBCTL CASE %IDC_TEXTBOX1 CASE %IDC_TEXTBOX2 CASE %IDC_BUTTON2 DIALOG END CBHNDL CASE %IDC_BUTTON1 IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN CONTROL GET TEXT CBHNDL, %IDC_TEXTBOX1 TO inputText CONTROL SET TEXT CBHNDL, %IDC_TEXTBOX2, inputText END IF END SELECT END SELECT END FUNCTION '-------------------------------------------------------------------------------- '-------------------------------------------------------------------------------- ' ** Dialogs ** '-------------------------------------------------------------------------------- FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG LOCAL lRslt AS LONG #PBFORMS Begin Dialog %IDD_DIALOG1->-> LOCAL hDlg AS DWORD DIALOG NEW hParent, "Dialog1", 248, 175, 215, 106, TO hDlg CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX1, "Type text here, then click the " + _ "Enter button", 25, 15, 150, 20, %WS_CHILD OR %WS_VISIBLE OR _ %WS_TABSTOP OR %ES_CENTER OR %ES_AUTOHSCROLL, %WS_EX_CLIENTEDGE OR _ %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX2, "", 25, 50, 150, 20 CONTROL ADD BUTTON, hDlg, %IDC_BUTTON1, "Enter", 180, 15, 30, 15 CONTROL ADD BUTTON, hDlg, %IDC_BUTTON2, "Exit", 85, 80, 50, 15 #PBFORMS End Dialog DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt FUNCTION = lRslt END FUNCTION '--------------------------------------------------------------------------------
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: