Parameter passing problem with pb3.5 
Author Message
 Parameter passing problem with pb3.5

Hi, all.

I am just getting back into DOS programming with PB 3.5 (I am sick of
Windows and C!) and I have run into a problem with passing a list of 8
parameters to a SUB.

If I compile in the IDE with the SUB inline in the source code,
everything works fine. But if I compile in the IDE with the SUB as a
separate file which I call with a $INCLUDE I cannot get the blasted
thing to compile with more than 7 parameters. The SUB does not lend
itself to splitting into fewer parameters without some goofy logic. I
could do the job with global variables or other such tricks, but I don't
want to. BTW, the 8-parameter list all fits onto one line, so that is
not the problem.

Is this a bug in PB3.5, or am I overlooking something?

TIA for any help, Doug



Mon, 19 Apr 2004 05:40:19 GMT  
 Parameter passing problem with pb3.5
Hi Doug,

It's certainly not a bug in powerbasic - PB supports up to 16
parameters per Suib/Function - more likely there is something in your
code that is causing the problems [somehow!].

What error message are you getting during compile?  It sounds like the
$INCLUDE metastatement is occurring below the line of code that
references the Sub [ie, a forward reference] in which case you'll
either need to use the CALL syntax [ie, CALL mysub(1,2,3,4,5,6,7,8)],
or move the $INCLUDE line up near the beginning of the file.

If this does not help, please post the exact error message you are
getting and we should be able to help further.

Thanks!

Quote:

>Hi, all.

>I am just getting back into DOS programming with PB 3.5 (I am sick of
>Windows and C!) and I have run into a problem with passing a list of 8
>parameters to a SUB.

>If I compile in the IDE with the SUB inline in the source code,
>everything works fine. But if I compile in the IDE with the SUB as a
>separate file which I call with a $INCLUDE I cannot get the blasted
>thing to compile with more than 7 parameters. The SUB does not lend
>itself to splitting into fewer parameters without some goofy logic. I
>could do the job with global variables or other such tricks, but I don't
>want to. BTW, the 8-parameter list all fits onto one line, so that is
>not the problem.

>Is this a bug in PB3.5, or am I overlooking something?

>TIA for any help, Doug

Lance
PowerBASIC Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com



Tue, 20 Apr 2004 09:32:28 GMT  
 Parameter passing problem with pb3.5
Hi, Lance, thanks for the reply.

First I must say that I really did not believe that there was a bug in PB3.5,
that was just the frustration talking. Now I realize that I should never have
written that!

The error I see is:
     Error 414: ")" expected
and the cursor is positioned under the comma following %GRAY.

I have tried erasing the offending line and retyping it, but the error still
shows. Frustration is comming back! :-(
As is said before, if I uncomment the SUB and comment out $INCLUDE
"PANEL.BAS", then everything works.
MISC.BAS and COLORS.BAS are simply collections of EQUATES.

This is a copy of the offending program:

$INCLUDE "MISC.BAS"
$INCLUDE "COLORS.BAS"
$INCLUDE "PANEL.BAS"

SCREEN 12

CALL Panel( 20, 100, 100, 120, %LIGHTGRAY, %WHITE, %GRAY, %UP )

LOCATE 10, 10
INPUT A$

END

'***************************************************************************

' Panel draws a solid-color (PnlColor%) rectangle bounded by a border
' 1 pixel wide.
' If %UpDown = %UP, then the top border and the left border are drawn in
' LtColor% and the bottom border and the right border are drawn in DkColor%.
' If %UpDown = %DOWN, then the border colors are reversed.
'
' $INCLUDE "MISC.BAS" and $INCLUDE "COLORS.BAS" must appear in the program
' source code prior to $INCLUDE "PANEL.BAS".

'SUB Panel( ULX%, ULY%, LRX%, LRY%, PnlColor%, LtColor%, DkColor%, UpDown% )

' LINE( ULX%, ULY% )-( LRX%, LRY% ), LtColor%, B
' LINE( ULX%+1, ULY%+1 )-( LRX%-1, LRY%-1 ), PnlColor%, BF
' IF UpDown% = %UP THEN
'   LINE( LRX%, LRY% )-( ULX%, LRY% ), DkColor%
'   LINE( LRX%, LRY% )-( LRX%, ULY% ), DkColor%
' ELSE
'   LINE( ULX%, ULY% )-( LRX%, ULY% ), DkColor%
'   LINE( ULX%, ULY% )-( ULX%, LRY% ), DkColor%
' END IF

'END SUB

Quote:

> Hi Doug,

> It's certainly not a bug in PowerBASIC - PB supports up to 16
> parameters per Suib/Function - more likely there is something in your
> code that is causing the problems [somehow!].

> What error message are you getting during compile?  It sounds like the
> $INCLUDE metastatement is occurring below the line of code that
> references the Sub [ie, a forward reference] in which case you'll
> either need to use the CALL syntax [ie, CALL mysub(1,2,3,4,5,6,7,8)],
> or move the $INCLUDE line up near the beginning of the file.

> If this does not help, please post the exact error message you are
> getting and we should be able to help further.

> Thanks!


> >Hi, all.

> >I am just getting back into DOS programming with PB 3.5 (I am sick of
> >Windows and C!) and I have run into a problem with passing a list of 8
> >parameters to a SUB.

> >If I compile in the IDE with the SUB inline in the source code,
> >everything works fine. But if I compile in the IDE with the SUB as a
> >separate file which I call with a $INCLUDE I cannot get the blasted
> >thing to compile with more than 7 parameters. The SUB does not lend
> >itself to splitting into fewer parameters without some goofy logic. I
> >could do the job with global variables or other such tricks, but I don't
> >want to. BTW, the 8-parameter list all fits onto one line, so that is
> >not the problem.

> >Is this a bug in PB3.5, or am I overlooking something?

> >TIA for any help, Doug

> Lance
> PowerBASIC Support

> -------------------------------------------------------------------------
> PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
> 316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com




Wed, 21 Apr 2004 23:25:45 GMT  
 Parameter passing problem with pb3.5
Hi Doug,

A small program and $INCLUDE file based on your snippet works fine for
me. Therefore,  I think you'll probably need to submit the *entire*
code to Tech Support and while I cannot make any promises, we'll try
to sort this out quickly for you.

Please remember to include your serial number in your email to us.

Thanks!

Quote:

>First I must say that I really did not believe that there was a bug in PB3.5,
>that was just the frustration talking. Now I realize that I should never have
>written that!

<smile>

Quote:
>The error I see is:
>     Error 414: ")" expected
>and the cursor is positioned under the comma following %GRAY.

Lance
PowerBASIC Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com



Thu, 22 Apr 2004 20:21:06 GMT  
 Parameter passing problem with pb3.5
Thanks, Lance, for the quick reply.

This is the full program! I was just writing an exercise to hone my PB skills
after a long layoff.

I think that the problem may be some fluke, so  I will just erase this program and
write it again. If you don't hear from me, it means that fixed the problem.

I do appreciate your efforts.

Doug.

Quote:

> Hi Doug,

> A small program and $INCLUDE file based on your snippet works fine for
> me. Therefore,  I think you'll probably need to submit the *entire*
> code to Tech Support and while I cannot make any promises, we'll try
> to sort this out quickly for you.

> Please remember to include your serial number in your email to us.

> Thanks!


> >First I must say that I really did not believe that there was a bug in PB3.5,
> >that was just the frustration talking. Now I realize that I should never have
> >written that!

> <smile>

> >The error I see is:
> >     Error 414: ")" expected
> >and the cursor is positioned under the comma following %GRAY.

> Lance
> PowerBASIC Support

> -------------------------------------------------------------------------
> PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
> 316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com




Sat, 24 Apr 2004 00:29:35 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Passing a parameter Rexx to JCL and return a parameter to JCL

2. language rules question: using a (passed in) parameter to define a parameter

3. Socket Select Parameter passing problem

4. Passing procedure parameters problem

5. Problem of passing string parameter in DLL's function from a C application

6. Problem passing KEY as parameter?

7. Ada to 'C' parameter passing problem

8. HELP: DLL's, parameter passing problem

9. Problem with parameter passing mechanisms

10. silly newbie problem -- passing parameters via URL

11. problem passing list parameter to tclsh subprocess

12. Problem with exec and bash and parameter passing

 

 
Powered by phpBB® Forum Software