[futurebasic] Re[2]: [FB] More pointers

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 1999 : Group Archive : Group : All Groups

From: "support@..." <support@...>
Date: Thu, 8 Jul 1999 12:29:07 -0500
Mel wrote...

MP> And if you open a component, you better close it too. Heres the FN for that :

Actually Mel, I do try to close it as shown in my function below. Problem is that
the call to the NAStuffToneDescription changes the value of naPtr& and then the
call to CloseComponent returns an error of -3000

LOCAL FN BuildTuneHeader&(@LongCount&)
  DIM header&,w&,w2&,thiserror&,kNoteRequestHeaderEventLength,mHnd&,w,naPtr&
  naPtr& = FN OpenDefaultComponent(_"nota",0)
  ~
  thiserror& = FN NAStuffToneDescription(naPtr&,1,mHnd&)
  PRINT "thiserror = " + STR$(thiserror&)
  ~
  thiserror& = FN CloseComponent(naPtr&)
  PRINT "thiserror = " + STR$(thiserror&)
END FN = header&

LOCAL MODE
LOCAL FN NAStuffToneDescription(na&,gmNum&,@td&)
  '---------------------------------------
  `     CLR.L     -(SP)
  `     MOVE.L    ^na&,-(SP)                      ;NoteAllocator
  `     MOVE.L    ^gmNum&,-(SP)                   ;LONGINT
  `     MOVE.L    ^td&,-(SP)                      ;Var: ToneDescription
  `     DC.W      $2F3C,$0008,$001B,$7000,$A82A
  `     MOVE.L    (SP)+,D0
END FN = REGISTER(D0)                             'ComponentResult

In your example are you setting up gInstance& beforehand as
a pointer or just when you make the assignment as below?
>    gInstance&=FN OpenDefaultComponent(_"PREF",_"ICAp"):'

if so, how did you do it?

Best wishes,
Robert Price
Programmer/Technical Support
support@...