Guest Posted July 22, 2003 Share Posted July 22, 2003 How do I retrieve the string that is entered into a CreateEditText box? Every time I type a letter, the handler gets what appears to be an address of where the string is stored in the data variable. How do I access this address to retrieve the string. Quote Link to comment
Jason33 Posted July 22, 2003 Share Posted July 22, 2003 Hello, I made a dialog template from the dialog builder tool some time ago, which I still use regularily. Here it is set up with a very simple STRING gathering purpose. I hope this helps. -Jason PROCEDURE dlog; Label 10; VAR dlogID,dlogResult : INTEGER; dialogIsOK,rsrcOK,nd: BOOLEAN; thestring :STRING; FUNCTION Define_Frame: INTEGER; VAR dialogID : INTEGER; BEGIN dialogID:=CreateLayout('Enter String',TRUE,'OK','Cancel') ; createstatictext(dialogid,4,'Enter String',16); createedittext(dialogid,5,thestring,16); setfirstlayoutitem(dialogid,4); setrightitem(dialogid,4,5,0,0); Define_Frame := dialogID; END; PROCEDURE Drive_Frame(VAR item:LONGINT; data:LONGINT); BEGIN CASE item OF {***Set up default values here****} SetupDialogC:BEGIN END; 1:BEGIN {*****user hit OK; gather values*****} thestring:=GetField(5); END; 2:BEGIN {*****user hit Cancel, enable GOTO to end command***} nd:=TRUE; END; END; END; {*****Main Script*******} BEGIN thestring:='Hello'; dlogID := Define_Frame; dialogIsOK := VerifyLayout(dlogID); IF dialogIsOK THEN BEGIN dlogResult := RunLayoutDialog(dlogID,Drive_Frame); END; IF nd THEN GOTO 10; message(thestring); 10: END; Run(dlog); Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.