Dilwyn wrote :

>> Minor point to note re. MAX_CON - it seems fine if used in the body of
>> a program, I seem to get problems under some conditions (especially
>> error conditions) if it is called from within a PROC or FN in SBASIC
>> (not apparent in SuperBASIC), you may find occasional 'missing End
>> Define' errors for example when there is clearly an End Define in the
>> program. 

I have tried to reproduce this ever since you first reported it to me all
those years ago (wasn't that a song ?) and I have been unfortunately unable
to do so. That was on a JM and a QXL.
I have just tried again, and still cannot get it to fail - QPC2v2 using the
following (line numbers omitted) :

init
:
def proc init
  local a%, b%, c%, d%
  print max_con(#0,a%,b%,c%.d%)
  print a%,b%,c%,d%
end def init


Running thie above, or calling init directly (both repeatedly) has no effect
(nearly wore out my ALT ENTER keys !)
REMming out the local definition also has no effect.
Adding a line like this :
 
  call_unknown_procedure_here

just before the end def simply stops with an error, but not an error looking
for an end def.

I can only ask that you supply me with a cut down version of a program which
you know fails please and I will investigate.
Could it be something else in the proc/fn is screwing the stack perhaps ?

(Sorry I can help more that that at this point)


>> Since you are an expert on maths stacks etc having found out
>> the hard way as your articles imply, I hate to mention this - any
>> chance there may be a stack error in there somewhere as I think the
>> SBASIC structures are to some extent stack based.

I have also looked into the code. Since I am using BP_LET (in QDOS speak) in
a loop to assign the integer at the top of the maths stack into the next
variable in the names list (in a loop to assign to all 4 integers) and then
I return the function result on the stack, correctly tidied, I can't see
anything wrong.

On the other hand, to the best of my knowlege, no other assembly language
book, writer or guru (not even Simon N Goodwin !) has ever described or used
BP_LET, so I had to find out about that utility all by myself. This doesn't
mean that I am correct, but so far, no errors on JM, QXL or QPC 1 or 2 or
2v2.

Unless anyone out there knows better .........


Regards, Norman.


PS. Well done Wales on Saturday (V France)   :o) :o) :o)

----------------------------------------------------------------------------
----
Norman Dunbar           EMail:  [EMAIL PROTECTED]
Database/Unix administrator     Phone:  0113 289 6265
Lynx Financial Systems Ltd.     Fax:    0113 201 7265
                        URL:    http://www.LynxFinancialSystems.com
----------------------------------------------------------------------------
----

Reply via email to