Jump to content
Developer Wiki and Function Reference Links ×

CreateEditText ?


Guest

Recommended Posts

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.

Link to comment

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);

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...