[Info-vax] VMS Software needs to port VAX DIBOL to OpenVMS X86 platform
mceculski2 at gmail.com
mceculski2 at gmail.com
Wed Dec 16 13:19:29 EST 2020
On Tuesday, December 15, 2020 at 2:47:43 PM UTC-5, Stephen Hoffman wrote:
> On 2020-12-15 15:59:28 +0000, ultradwc at gmail.com said:
>
> > THINK OF DIBOL AS A TYPE OF 4 GL COBOL
> >
> > RECORD MISC
> > NUMBOTTLES ,D2,99 ;Default # of bottles to 99
> > ANUMBOTTLES ,A2 ;Used to mask the output of bottles
> >
> >
> > PROC
> > XCALL FLAGS (0007000000,1) ;Suppress STOP message
> > OPEN (8,O:C,"TT:") ;Open the terminal/display
> > REPEAT
> > BEGIN
> > ANUMBOTTLES = NUMBOTTLES,'ZX'
> > WRITES (8,ANUMBOTTLES+" Bottles of Beer on the wall,")
> > ANUMBOTTLES = NUMBOTTLES,'ZX'
> > WRITES (8,ANUMBOTTLES+" Bottles of Beer,")
> > WRITES (8," Take one down, pass it around,")
> > DECR NUMBOTTLES ;Reduce # of bottles by 1
> > IF (NUMBOTTLES .LE. 1) EXITLOOP ;If just 1 bottle left, get out
> > ANUMBOTTLES = NUMBOTTLES,'ZX'
> > WRITES(8,ANUMBOTTLES+" Bottles of Beer on the wall.") WRITES (8," ")
> > END
> > ANUMBOTTLES = NUMBOTTLES,'ZX'
> > WRITES(8,ANUMBOTTLES+" Bottle of Beer on the wall.") WRITES (8," ")
> > WRITES (8,ANUMBOTTLES+" Bottle of Beer on the wall,")
> > WRITES (8,ANUMBOTTLES+" Bottle of Beer,")
> > WRITES (8," Take one down, pass it around,")
> > WRITES (8," ")
> > WRITES (8," ")
> > WRITES (8, "Hey the Beer's gone, I am out of here...")
> > SLEEP 2
> > CLOSE 8
> > STOP
> > END
>
>
> For grins, and written entirely off the cuff...
>
>
>
>
> for i in (1...99).reversed() {
> print("\(i) bottle\((i == 1 ? "" : "s")) of beer on the wall, \(i)
> bottle\((i == 1 ? "" : "s")) of beer.")
> print("Take one down and pass it around, ", terminator: "")
> if i == 1 {
> print("no more bottles of beer on the wall.")
> } else {
> print("\(i - 1) more bottle\((i == 2) ? "" : "s") of beer on the wall.)
> }
> }
> print("No more bottles of beer on the wall, no more bottles of beer.")
> print("Hey, the beer's all gone, I'm outta here.")
>
>
>
>
>
> This Swift code would be a little less involved if the code was
> switched to the internationalized support for text messages and for
> pluralization, and with the text strings moved to a local-language
> file. This Swift code also eschews OO features, etc.
>
> Other languages may and variously will be shorter than DIBOL or COBOL
> code, too.
>
> But then back to the original DIBOL availability question, the
> production compilers and production OpenVMS x86-64 availability are all
> going to be 2022 at the earliest. And quite possibly 2023, if something
> slips somewhere. Call back closer to then, and maybe Synergex has a
> port underway, or has a DIBOL compiler available.
>
>
>
> --
> Pure Personal Opinion | HoffmanLabs LLC
YOU DIDN'T THINK I WOULD PASS ON A CHALLENGE DID YOU? :)
THAT WAS AN OLD VAX DIBOL CODE EXAMPLE NOT USING THE FOR LOOP STRUCTURE
BEHOLD THE POWER OF SYNERGY DIBOL I THINK MY CPU PROCESS TIME WILL BEAT YOURS
RECORD MISC
I ,D2
NUMBOT ,D2,99 ; Set default to 99
PROC
XCALL FLAGS (0007000000,1) ;Supress STOP message
OPEN(15,O:C,"TT:") ;Open the terminal/display
FOR I FROM NUMBOT THRU 1 BY -1
DO
BEGIN
USING NUMBOT SELECT
(1), BEGIN
DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottle of Beer on the wall,',13,10)
DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottle of Beer,',13,10)
DISPLAY(15,' Take one down, pass it around,',13,10)
DISPLAY(15,13,10,'Hey the Beer's gone, I am out of here...',13,10)
END
(), BEGIN
DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottles of Beer on the wall,',13,10)
DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottles of Beer,',13,10)
DISPLAY(15,' Take one down, pass it around,',13,10)
DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottles of Beer on the wall.',13,10,13,10)
END
ENDSUING
END
SLEEP 2
CLOSE 15
STOP
More information about the Info-vax
mailing list