Re: Adding a GUI to a Forth system
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.fortran Profile…
 Up
Re: Adding a GUI to a Forth system         


Author: Mike T
Date: Jul 11, 2006 07:35

Hi Gerry,

My answer to question five, the following alternative approaches spring
to mind:

1 Repackage your C++ Forth as a DLL and host that within the VB
process. You should be able to provide a simple Forth/VB interface
based on TYPE, EMIT, ACCEPT, REFILL, etc. You will have to provide
other words (ie. functions/callbacks) for driving the GUI. A separate
makefile can be used for generating a standalone EXE Forth. You can
debug your Forth using the C++ debugger by specifying VB.EXE as the
debug process.
2 Provide a mapping to a C++ GUI library, such as MFC, within your C++
Forth. This sounds quite awkward and a lot of work.
3 Devise a foreign function interface within your Forth so that you can
make direct Win32 OS calls. Lots of work but will give the most
flexibility.

My view is that GUI coding can be very time consuming and fiddly.
Driving a simple bespoke interface such as an Othello board should work
fine using streams. If you are happy with your approach then stick
with that.
Show full article (1.02Kb)
6 Comments
Re: Functions that return character strings         


Author: Dick Hendrickson
Date: Jul 27, 2006 09:20

John Harper wrote:
> In article <44c752b1$0$3284$ec3e2dad@news.usenetmonster.com>,
> David Frank hotmail.com> wrote:
>
>>Note that F95 has below varying string technique to address a varying size
>>char array
>>which works just fine using CVF...
>>
>>! --------------------------
>>program varying_string_using_varying_array
>>character,allocatable,target :: a(:)
>>character,pointer :: vstring
>>character(80) :: lines(2) = ['The Quick Brown Fox ', &
>> "Jumps Over The Lazy Dog's Back."]
>>do i = 1,size(lines)
>> if (allocated(a)) deallocate (a)
>> nc = len_trim(lines(i)) ; allocate ( a(nc) )
>> vstring => a(1) ! point at array start
Show full article (3.79Kb)
5 Comments
Re: Functions that return character strings         


Author: Dick Hendrickson
Date: Jul 27, 2006 09:24

I take this all back. I misread what was going on with
the character lengths and arraynesses of a.

I guess I shouldn't post in a hurry, sigh.

Dick Hendrickson

Dick Hendrickson wrote:
>
>
> John Harper wrote:
>
>> In article <44c752b1$0$3284$ec3e2dad@news.usenetmonster.com>,
>> David Frank hotmail.com> wrote:
>>
>>> Note that F95 has below varying...
Show full article (4.13Kb)
4 Comments
Re: Functions that return character strings         


Author: Rich Townsend
Date: Jul 27, 2006 10:18

Dick Hendrickson wrote:
> I take this all back. I misread what was going on with
> the character lengths and arraynesses of a.
>
> I guess I shouldn't post in a hurry, sigh.

But I'm still a little confused. If vstring is declared as a pointer to a scalar
(the scalar being a length-1 character), then how can it accept an array subscript?

Rich
>
> Dick Hendrickson
>
> Dick Hendrickson wrote:
>>
>>
>> John Harper wrote:
>>
>>> In article <44c752b1$0$3284$ec3e2dad@news.usenetmonster.com>,
>>> David Frank hotmail.com> wrote:
>>>
...
Show full article (4.43Kb)
3 Comments
Re: Functions that return character strings         


Author: Dick Hendrickson
Date: Jul 27, 2006 13:38

Rich Townsend wrote:
> Dick Hendrickson wrote:
>
>> I take this all back. I misread what was going on with
>> the character lengths and arraynesses of a.
>>
>> I guess I shouldn't post in a hurry, sigh.
>
>
> But I'm still a little confused. If vstring is declared as a pointer to
> a scalar (the scalar being a length-1 character), then how can it accept
> an array subscript?
>

vstring is a scalar character variable of length one.
vstring(1:nc) isn't an array subscript, it's a character
section selector. They jusy happen to have the same
syntax and you need to look at the declaration to tell
what "(1:nc)" really is. Since the length of vstring is
one, nc must be less than or equal to 1 to be valid.
> Rich
>
>>
>> Dick Hendrickson
>>
>> Dick Hendrickson wrote:
>>
>>>
>>>
>>> John Harper wrote:
>>>
>>>> In article <44c752b1$0$3284$ec3e2dad@news.usenetmonster.com>,
>>>> David Frank
Show full article (5.17Kb)
2 Comments
Re: Functions that return character strings         


Author: Rich Townsend
Date: Jul 27, 2006 15:04

Dick Hendrickson wrote:
>
>
> Rich Townsend wrote:
>> Dick Hendrickson wrote:
>>
>>> I take this all back. I misread what was going on with
>>> the character lengths and arraynesses of a.
>>>
>>> I guess I shouldn't post in a hurry, sigh.
>>
>>
>> But I'm still a little confused. If vstring is declared as a pointer
>> to a scalar (the scalar being a length-1 character), then how can it
>> accept an array subscript?
>>
>
> vstring is a scalar character variable of length one.
> vstring(1:nc) isn't an array subscript, it's a character
> section selector. They jusy happen to have the same ...
Show full article (5.48Kb)
1 Comment
Re: Functions that return character strings         


Author: Dick Hendrickson
Date: Jul 28, 2006 09:41

Rich Townsend wrote:
> Dick Hendrickson wrote:
>
>>
>>
>> Rich Townsend wrote:
>>
>>> Dick Hendrickson wrote:
>>>
>>>> I take this all back. I misread what was going on with
>>>> the character lengths and arraynesses of...
Show full article (1.06Kb)
no comments