TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: TIM HUTZLER
date: 1996-06-10 13:59:00
subject: Passing a field

The following shows a problem that I am having
'define the array
TYPE xs
 str as string * 15
end type
dim t as xs
'load it
t.str = "This is a test."
do
 INCR x%
    y$ = mid$(t.str, x%, 1)
'HERE IS THE PROBLEM.....
'(A) this will work
    z$ = t.str
    POUT x%, y$, z$
    t.str = z$
'(B) but this will not! I get a 481 error.
    POUT x%, y$, t.str
loop until y$ = "."
SUB pout (x%, x$, t$)
    PRINT x%, x$, t$
    t$ = "vxvxvxv."
END SUB
===================================
This tells me that PB thinks t.str is a non-string in a subroutine call.
I can pass BYVAL, and no error occurs.
Of course, I can't modify the field by passing bu value.
How can I run instance (B) an not get a compile error.
 
___ Blue Wave/QWK v2.12
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 916-893-8079 * (1:119/88)

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™.