PDA

View Full Version : Newbie Question re: setting edit ctrl text


plinydogg
10-20-2006, 01:20 AM
Hi, I've got a really really simple question. While I'm asking it I also want to ask if you've considered creating a newbie forum category. You all seem very experienced and I don't want to clutter your real questions with my baby steps. Just a thought.

Here's my question. How do you change the text of an edit control? In VB I would just do something like the following (I think):

editControl.text = "the text I want"

In PPL, I think I need to use SETTEXT and write something like this:

SETTEXT (editControlHandle$, "the text I want");

However, I'm not sure how to give the editcontrol a handle. How do I do this? By placing something like this within WinMain():

editControlHandle$ = nameOfEditControl;

Any help would be much appreciated and sorry to clutter the forum with rookie questions.

kornalius
10-20-2006, 01:26 AM
Each control in the PIDE has a name. That name becomes a variable once generated by the code generator.

Ex:

Edit101 becomes Edit101$. That is the handle you will need to use.

You can try:

Edit_Set(Edit101$, "Text");

This would do just fine too:

SetText(Edit101$, "Text");

Don't be sorry we need all kind of questions here. You questions will certainly help other users. You are contributing in a great way without knowing.

plinydogg
10-20-2006, 01:47 AM
Kornalius,

First of all, thanks for the lightning fast reply...6 minutes, wow!!!!

Secondly, both of those lines of code work fine. I've got one follow up question: the Edit_Set procedure is part of the Simplified API right? So why does it work even though I didn't #include "swapi"?

P.S. I like your avatar!

PointOfLight
10-20-2006, 02:33 AM
You've included swapi, and just don't know it !lol Apparently Kornalius has decided to include that module by default for GUI applications, which is actually really cool. I couldn't imagine writing a GUI app without that set of functions.

plinydogg
10-20-2006, 02:36 AM
Thanks for making sense of that for me POL! Now that I know those functions are there, I'll explore them a bit (once I can get past these baby steps).

kornalius
10-20-2006, 11:19 AM
Yep, #include "swapi" is part of the PIDE and VFB form code generator.