[futurebasic] Re: [FB] Porting program

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

From: Robert Purves <listrp@...>
Date: Fri, 18 Jan 2008 19:30:08 +1300
Bob Bryce wrote:

> I have been working on reprogramming my MacAutoFormat program
> to run on my Intel MacBook. It worked well on PPC PowerBook
>    but I haven’t figured out how to
> compile it to also run on the PowerBook.

Are you porting from
	FBII to FB4
	Standard BASIC to Appearance runtime
	Classic to OS X
	FB to FBtoC
or something else?


> Porting to Carbon.pdf says Records are now opaque and I read on your
> list that huge Global Files don’t port over too well.

The Porting to Carbon document (in FB Help) is old. Its intention was  
to help FB programmers move from Classic to OS X. The records that  
"are now opaque" are those in the Carbon API (e.g. CWindowRecord,  
CGrafPort). Your FB records were unaffected by Apple's changes all  
those years ago.

FB code can show a bug attributable to the layout of global variables.  
The circumstances are rare, the diagnosis quick, and the bug easily- 
fixed. Don't worry about it.

> 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

Your declaration of the fields MTBold%, MTItalic% and MTUnderline%  
uses an undocumented syntax. Oddly, neither the FB Compiler nor FBtoC  
treats the stray '4' as an error. I've entered a bug against FBtoC,  
saying that it should give a translation error.
Remove the 3 stray '4's.

Robert P.