Structures with string data

From: Cameron Bowes <cbowes_at_worldnet.att.net>
Date: Wed, 27 Oct 1999 18:52:55 -0400

Greetings -

I'm working through Petzold's Programming Windows95 to get myself up to speed
with the WIn32 API. Several programs in the book use a structure defined as
(for example in Chapter 3):

struct
{
int iIndex;
char *szLabel;
char *szDesc;
}

then defines an array:

sysmetrics [] =
{
SM_CXSCREEN, "SM_CXSCREEN", "Screen width in pixels",
SM_CYSCREEN, "SM_CYSCREEN", "Screen height in pixels",
....
}

using the structure.

I'm stumped at setting up a similar definition in Swiftforth. I found
Options\Win32\MsgText.f which uses a neat [SWITCH keyword, DATA: which lets you
comma-quote variable length string data into the switch structure, but that's
not quite generalized enough since access is through the switch value, not a
simple index. BTW, is DATA: described anywhere? I couldn't find reference to
it in the docs.

Am I missing something simple where I should be using CREATE...DOES?

Any tips would be greatly appreciated!

Kindest regards,

Cam Bowes
cbowes_at_worldnet.att.net

.
Received on Wed Oct 27 1999 - 18:52:55 PDT


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.