f



C=128 Basic 7.0 HEADER command with variables

 I am trying to use the header command with a variable and it won't
work with the DISK ID as a variable.

A$="Disk-NAME"
B$="9U"
HEADER (A$),I(B$),D0,U8

Gives a syntax error.
HEADER (A$),I9U,D0,U8

Works fine. 

TIA.
0
GEO
11/1/2016 2:33:38 PM
comp.sys.cbm 14331 articles. 0 followers. dunric (341) is leader. Post Follow

3 Replies
370 Views

Similar Articles

[PageSpeed] 26

On Tue, 01 Nov 2016 07:33:38 -0700, GEO wrote:
>
>  I am trying to use the header command with a variable and it won't
> work with the DISK ID as a variable.
>
> A$="Disk-NAME"
> B$="9U"
> HEADER (A$),I(B$),D0,U8
>
> Gives a syntax error.
> HEADER (A$),I9U,D0,U8
>
> Works fine. 

Did you declare the array(s)? Suppose "I(B$)" is an array. But then I
don't know C=128 Basic 7.0.
-- 
Andreas
You know you are a redneck if
your good deed for the month was hiding your brother for a few days.
0
Andreas
11/1/2016 9:43:36 PM
On Tue, 01 Nov 2016 07:33:38 -0700, GEO <ghandle75.x@gmail.com-SPAM>
wrote:

> I am trying to use the header command with a variable and it won't
>work with the DISK ID as a variable.
>
>A$="Disk-NAME"
>B$="9U"
>HEADER (A$),I(B$),D0,U8
>
>Gives a syntax error.
>HEADER (A$),I9U,D0,U8
>
>Works fine. 
>
>TIA.


I solved this by putting everything into one variable:

A$="Disk-NAME": B$=",I":C$="7U"
A$=A$+B$+C$
HEADER (A$),D0,U8
0
GEO
11/2/2016 6:17:36 PM
"GEO" <ghandle75.x@gmail.com-SPAM> wrote in message 
news:nm9h1cl5g0f66qdjofd23tps7rsvivtm6k@4ax.com...
> I am trying to use the header command with a variable and it won't
> work with the DISK ID as a variable.
>
> A$="Disk-NAME"
> B$="9U"
> HEADER (A$),I(B$),D0,U8
>
> Gives a syntax error.

I(B$) is interpreted as an array variable. BASIC does not allow array 
indices to be strings. You would get the same syntax error wherever you 
tried to do this.

- Anton Treuenfels 

0
Anton
11/2/2016 10:16:09 PM
Reply: