[futurebasic] Porting program

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2008 : Group Archive : Group : All Groups

From: "Bob Bryce" <rrbryce@...>
Date: Fri, 18 Jan 2008 04:01:36 +0000
Hi,

I have been working on reprogramming my MacAutoFormat program
to run on my Intel MacBook. It worked well on PPC PowerBook. I have Program
Window and Menu structure working and have programmed several of the MANY
windows in the program and Cancel and O.K. buttons work. This minimal progam
outline compiles and runs on my Intel MacBook but I havent figured out how 
to
compile it to also run on the PowerBook.

Porting to Carbon.pdf says Records are now opaque and I read on your
list that huge Global Files dont port over too well. I had many Globals
to retrieve info to use in the program calculations.

PROBLEM: My original program had many, many Record structures like;

BEGIN RECORD MTInfo
  DIM as str255 MTfontName$
  DIM 4 MTfontSize$
  DIM as str255 MTStyleName$
  DIM 4 MTStyleNumber$
  DIM 4 MTsb$
  DIM 4 MTsa$
  DIM 4 MTsl$
  DIM 4 MTBold%
  DIM 4 MTItalic%
  DIM 4 MTUnderline%
  DIM MTButtonState%
END RECORD

DIM gMT.MTInfo

(MT is short for Main Title an Standard Format tag)

gMT.MTInfo was a handle used to retrieve info from the fields where I keyed
in the font, font size info etc. to use in program calculations.

This doesnt work anymore so I have DIMd the MT into in the MT Window
to get my windows up and working.

How do I retrieve the MTInfo from the fields in the MT window and pass it
to appropriate Functions? For instance if I click on CANCEL button I want
to call the following function to erase the information in the fields;

LOCAL FN BlankMTRecord
  DEF BLOCKFILL (@gMT, _MTInfo, 0)
END FN

gMT was a handle to the MTInfo Record; since this no longer works
I need a method of passing all this information. This FN gives error
variable gMT has not been dimd in BlankMTRecord.
DEF BLOCKFILL (2gMT, _MTInfo, 0)
Too many parameters, or mismatched 0

Of course all _MTInfo etc. were all in my GLOBAL file which
now seems opaque to the program in Carbon.

There was a similar FUNCTION FN getMTRecord to capture the MTInfo
when the OK Button is clicked and use it to calculate info for the program:

LOCAL FN getMTRecord
  WINDOW OUTPUT 4
  gMT.MTfontName$=EDIT$(_EFMTfontName)
  gMT.MTfontSize$=EDIT$(_EFMTfontSize)
  gMT.MTStyleName$=EDIT$(_EFMTStyleName)
  gMT.MTStyleNumber$=EDIT$(_EFMTStyleNumber)
  gMT.MTsb$=EDIT$(_EFMTsb)
  gMT.MTsa$=EDIT$(_EFMTsa)
  gMT.MTsl$=EDIT$(_EFMTsl)
  gMT.MTBold%=BUTTON (_check1)
  gMT.MTItalic%=BUTTON (_check2)
  gMT.MTUnderline%=BUTTON (_check3)
  MENU _mFormatSFM, 1, _checked
END FN

How do I go about reprogaming this??

Thanks

Bob Bryce