TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: KENTON W. MELLOTT
date: 1998-02-15 18:32:00
subject: COMMON EMS VARIABLES & C

From: "Kenton W. Mellott" 
Subject: COMMON  EMS VARIABLES & CHAINed programs
 
    Have some concerns about the only way that I
was able to get COMMON to work with the
DIM statements for CHAINed Programs.
 
After some fiddle I was finally able to get a VIRTUAL ARRAY
using:
    DIM VIRTUAL EMm(Count%) as STRING * 16384
 
But the COMMON statement will not work with DIM,
it says I am trying to use a name twice.  So I put it
afterward.
 
    DIM VIRTUAL EMm(Count%) as STRING * 16384
    COMMON Ini$, EMn$(1), JumpTo$
When I tried this in the CHAINed program, it said
I was trying to DIM what had already been DIMed.
 
But when I left DIM out the CHAINed program
would come up with an empty string when I asked
for EMm$(Count%).
 
I finally introduced the Ini$ variable at this point
and asked for it before DIM or COMMON statements
If it was "Y", being yes DIM was initialized, it would
skip the DIM statement and just go to COMMON.
 
Doing this in both the startup program and the
chained program worked.
 
Is there a more proper way?
 
Thank you for your input.
Sincerely,
 
Gregory D. Mellott
melken@co.tds.net
 
 
*** QwkNews (tm) v2.1
 * [TN71] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.