🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
6 messages
6 total messages Started by Pat Mueller Mon, 25 Jan 1993 22:52
Re: Rexx question
#3637
Author: Pat Mueller
Date: Mon, 25 Jan 1993 22:52
52 lines
1671 bytes
>I'm doing a little Rexx programming and came upon the following:
>/* */
>
>line = "prpipgphptp"
>
>do while((n = pos("p", line)) \= 0)
> line = overlay(" ", line, n)
>end
>
>say line
> ...
>The output when this program is run is the following:
>
>prpipgphptp
>...

The construct
   do while((n = pos("p", line)) \= 0)
while legal, probably doesn't do what you want it to.  It compares
the variable "n" with the value of the pos() function call.  The
resulting comparison (whose value is 0 or 1) is compared to 0.

Basically, rexx has no assignment operator that can be used within
expressions (like C does).  Your second try is the way to do it.

When in doubt, insert a 'trace ?i' line at the top of your program
and you'll see all the gory details of statement evaluation.  An
example follows:

     4 *-* line = "prpipgphptp"
       >L>   "prpipgphptp"
       +++ Interactive trace.  TRACE OFF to end debug, ENTER to continue

     6 *-* do while((n = pos("p", line)) <> 0)
       >L>   "N"
       >L>   "p"
       >V>   "prpipgphptp"
       >F>   "1"
       >O>   "0"
       >L>   "0"
       >O>   "0"

    10 *-* say line
       >V>   "prpipgphptp"
   prpipgphptp


If still in doubt, comp.lang.rexx is the best place to get answers
regarding rexx in general.

Patrick Mueller                  addr:  pmuellr@vnet.ibm.com
IBM Cary, North Carolina         phone: 919-469-7242
basic
#3682
Author: Robert C. Merritt <rcmerrit>
Date: Tue, 26 Jan 1993 21:06
8 lines
727 bytes
ok, sincce there doesn't appear to be an os/2 version of basic or pascal,
and since I refuse to work in C, 

how can I take my dos basic or pascal complier and make programs that are
os/2 and/or PM friendly?

Rob Merritt
Re: basic
#3684
Author: Timothy F. Sipples
Date: Wed, 27 Jan 1993 01:30
25 lines
1717 bytes
In article <1993Jan26.210637.4258@apgea.army.mil> rcmerrit@apgea.army.mil (Robert C. Merritt <rcmerrit>) writes:
>ok, sincce there doesn't appear to be an os/2 version of basic or pascal,
>and since I refuse to work in C, 
>how can I take my dos basic or pascal complier and make programs that are
>os/2 and/or PM friendly?

You cannot, but your initial premise is flawed.

There are many 16-bit OS/2 BASICs, including, would you believe,
Microsoft's, IBM's, and a few others.  There is no 32-bit BASIC for
OS/2 (yet).

There is one 32-bit Pascal for OS/2, Microway's.  There are several
16-bit versions for OS/2, including Clarion's TopSpeed Pascal (which I
use).

Get ahold of the file tinf31.zip, available via anonymous ftp from
ftp-os2.nmsu.edu -- check file /pub/os2/00Index for location.  It
lists a lot of BASIC and Pascal compilers for OS/2.

-- 
Timothy F. Sipples      | READ the OS/2 FAQ List 2.0i, available from
sip1@ellis.uchicago.edu | 128.123.35.151, anonymous ftp, in /pub/os2/all/info
Dept. of Econ., Univ.   | /faq, or from LISTSERV@BLEKUL11.BITNET (send "HELP")
of Chicago, 60637       | [Post to ONE newsgroup only AFTER reading the List.]
Re: basic
#3678
Author: Darrel Hankerson
Date: Thu, 28 Jan 1993 03:43
24 lines
1648 bytes
In article <1993Jan26.210637.4258@apgea.army.mil> rcmerrit@apgea.army.mil (Robert C. Merritt <rcmerrit>) writes:
>ok, sincce there doesn't appear to be an os/2 version of basic or pascal,
>and since I refuse to work in C, 

You like pascal but refuse to work in C?


>how can I take my dos basic or pascal complier and make programs that are
>os/2 and/or PM friendly?

There is Bywater Basic 1.10, recently released and available on 
simtel20.army.mil. This compiles using MSC 6.00A for OS/2. I only briefly
examined, and the language features are interesting, but not OS/2 specific
and it is not very fast.  You did not indicate what type of programming.
If your BASIC needs are very basic, then this might work. If you examine
the docs on simtel, and decide that it will suit your purpose, I can send
you my version which is compiled for OS/2. Note carefully: this BASIC is 
designed to run on a variety of platforms. It is not fancy and does not
include any special OS/2 features.  

I only examined out of curiosity at this old language. I use C and refuse
to program in BASIC or PASCAL :)

--darrel
Re: basic
#3715
Author: Juergen Weber
Date: Thu, 28 Jan 1993 11:02
12 lines
960 bytes
In article <1993Jan26.210637.4258@apgea.army.mil> rcmerrit@apgea.army.mil (Robert C. Merritt <rcmerrit>) writes:
>
>ok, sincce there doesn't appear to be an os/2 version of basic or pascal,
>and since I refuse to work in C, 
>
>how can I take my dos basic or pascal complier and make programs that are
>os/2 and/or PM friendly?
>
>Rob Merritt

There is a free UNIX program called P2C that translates Pascal source
into C source. Maybe somebody could port it to OS/2.
Re: basic
#3700
Author: Martin Lansche
Date: Thu, 28 Jan 1993 13:53
26 lines
1702 bytes
In <1993Jan26.210637.4258@apgea.army.mil> Robert C. Merritt <rcmerrit> writes:
>ok, sincce there doesn't appear to be an os/2 version of basic or pascal,
>and since I refuse to work in C,
>
>how can I take my dos basic or pascal complier and make programs that are
>os/2 and/or PM friendly?
>
>Rob Merritt
>

Rob,
   Have you considered REXX?  It comes with OS/2 and is superior to BASIC,
is, in some ways, similar to Pascal (yet without all that type-constrictions).
All variables are strings.... They are defined as they are used... Give it a
try.  REXX = one of the best kept "secrets" of OS/2...

Cheers,
Martin Lansche, IBM PRGS Toronto Lab, Canada
  ________________________________________________________________________
   Ilu Iluvatar en kare eldain a firimoin ar antarota mannar valion :
   numessier.  Toi aina, mana, meldielto -- enga morion : talantie.
   ----------------------------------------------------------------------
   The father made the world for elves and mortals and he gave it into
   the hands of the Lords in the West.  They are blessed, holy and loved,
   except the black one.  He has fallen.  (J.R.R. Tolkien).
  ________________________________________________________________________
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads